/* ─── PAGE HEADER PRODUITS FINIS (Matière première) ─── */
  #section-produitsFinis .page-header {
    background: linear-gradient(130deg, #1A6BFF 0%, #4f46e5 60%, #7C5CFC 100%);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 6px 28px rgba(26,107,255,0.28), 0 1px 0 rgba(255,255,255,0.08) inset;
    position: relative;
    overflow: hidden;
  }
  #section-produitsFinis .page-header::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 160px; height: 160px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    pointer-events: none;
  }
  #section-produitsFinis .page-header::after {
    content: '';
    position: absolute;
    bottom: -55px; left: 30%;
    width: 110px; height: 110px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    pointer-events: none;
  }
  #section-produitsFinis .page-header .ph-icon {
    width: 44px; height: 44px;
    background: rgba(255,255,255,0.14);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(6px);
  }
  #section-produitsFinis .page-header .ph-text { flex: 1; min-width: 0; }
  #section-produitsFinis .page-header h4 {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff !important;
    letter-spacing: -.3px;
    line-height: 1.2;
  }
  #section-produitsFinis .page-header p {
    font-size: 11.5px;
    color: rgba(255,255,255,0.72);
    margin-top: 2px;
    font-weight: 400;
    line-height: 1.4;
  }
  #section-produitsFinis .page-header .ph-badge {
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 5px 13px;
    border-radius: 99px;
    letter-spacing: .8px;
    text-transform: uppercase;
    flex-shrink: 0;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.28);
    white-space: nowrap;
  }
  #section-matieresPremières .page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(26,107,255,0.18);
    position: relative;
    overflow: hidden;
  }
  #section-matieresPremières .page-header::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 120px; height: 120px;
    background: rgba(255,255,255,0.07);
    border-radius: 50%;
  }
  #section-matieresPremières .page-header::after {
    content: '';
    position: absolute;
    bottom: -40px; right: 60px;
    width: 80px; height: 80px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
  }
  #section-matieresPremières .page-header .ph-icon {
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.15);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 22px;
    backdrop-filter: blur(4px);
  }
  #section-matieresPremières .page-header .ph-text { flex: 1; }
  #section-matieresPremières .page-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -.3px;
  }
  #section-matieresPremières .page-header p {
    font-size: 12.5px;
    color: rgba(255,255,255,0.75);
    margin-top: 3px;
    font-weight: 400;
  }
  #section-matieresPremières .page-header .ph-badge {
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: .4px;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.25);
  }
  :root {
    --primary: #1A6BFF;
    --primary-dark: #0F4FCC;
    --primary-light: #E8F0FF;
    --primary-glow: rgba(26, 107, 255, 0.15);
    --white: #FFFFFF;
    --bg: #F5F8FF;
    --surface: #FFFFFF;
    --surface2: #EEF3FF;
    --border: rgba(26, 107, 255, 0.12);
    --text: #0D1B3E;
    --text-muted: #6B7FA3;
    --text-light: #A0B0CC;
    --green: #00C48C;
    --amber: #FFB800;
    --red: #FF4D6A;
    --purple: #7C5CFC;
    --sidebar-w: 260px;
    --header-h: 64px;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 2px 16px rgba(26,107,255,0.08);
    --shadow-md: 0 8px 32px rgba(26,107,255,0.14);
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  body {
    font-family: 'Sora', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
  }

  /* ─── SIDEBAR ─── */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(26,107,255,0.06);
  }

  .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--border);
  }

  .logo-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(26,107,255,0.3);
    flex-shrink: 0;
  }

  .logo-text h1 {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
  }
  .logo-text span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: .4px;
  }

  .nav-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    scrollbar-width: none;
  }
  .nav-scroll::-webkit-scrollbar { display: none; }

  .nav-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.2px;
    color: var(--text-light);
    text-transform: uppercase;
    padding: 10px 8px 6px;
  }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .2s;
    margin-bottom: 2px;
    position: relative;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
  }
  .nav-item:not(.nav-sub-item) {
    border-color: rgba(26,107,255,0.08);
    background: rgba(26,107,255,0.015);
  }

  .nav-item:hover {
    background: var(--primary-light);
    color: var(--primary);
  }

  .nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
  }
  .nav-item.active .nav-icon { color: var(--primary); }

  .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
  }

  /* ─── NAV SUBMENU / ACCORDION ─── */
  .nav-parent { user-select: none; }
  .nav-parent .nav-icon svg { display: block; }
  .nav-sub-item { padding-left: 38px; font-size: 13px; color: var(--text-muted); }
  .nav-sub-item .nav-icon { color: var(--text-light); }
  .nav-sub-item:hover .nav-icon,
  .nav-sub-item.active .nav-icon { color: var(--primary); }

  .nav-submenu {
    overflow: hidden;
    max-height: 0;
    transition: max-height .3s cubic-bezier(.4,0,.2,1);
  }
  .nav-submenu.open { max-height: 200px; }

  .nav-chevron.rotated { transform: rotate(180deg); }

  .nav-icon svg { display: block; }

  .nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    font-family: 'DM Mono', monospace;
  }

  .nav-badge.amber { background: var(--amber); color: #1a1000; }
  .nav-badge.red { background: var(--red); }
  .nav-badge.green { background: var(--green); }

  /* Sidebar user card */
  .sidebar-user {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface2);
  }

  .user-avatar {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
  }

  .user-info { flex: 1; min-width: 0; }
  .user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .user-email {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .user-status {
    display: flex; align-items: center; gap: 4px;
    font-size: 10px; color: var(--green); font-weight: 500; margin-top: 2px;
  }
  .user-status::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--green);
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 2s infinite;
  }

  .btn-logout {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: rgba(255,77,106,.1);
    border: none;
    color: var(--red);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: background .2s;
    flex-shrink: 0;
  }
  .btn-logout:hover { background: rgba(255,77,106,.2); }

  /* ─── HEADER ─── */
  .topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    z-index: 90;
    box-shadow: 0 2px 12px rgba(26,107,255,0.05);
    transition: left .35s cubic-bezier(.4,0,.2,1);
  }

  .hamburger {
    display: none;
    width: 36px; height: 36px;
    border: none; background: var(--primary-light);
    border-radius: 8px; cursor: pointer;
    align-items: center; justify-content: center;
    font-size: 18px; color: var(--primary);
    flex-shrink: 0;
  }

  .topbar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
  }

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

  .topbar-btn {
    width: 36px; height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    color: var(--text-muted);
    position: relative;
    transition: all .2s;
  }
  .topbar-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

  .notif-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    background: var(--red);
    border-radius: 50%;
    border: 2px solid white;
  }

  .tb-badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 18px; height: 18px;
    background: var(--red);
    color: #fff;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(255,77,106,.4);
    animation: tb-pop .25s cubic-bezier(.34,1.56,.64,1);
  }
  .tb-badge-green { background: var(--green); box-shadow: 0 2px 6px rgba(0,196,140,.4); }

  @keyframes tb-pop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
  }

  .nf-chip {
    flex: 1;
    padding: 4px 0;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: #fff;
    font-family: 'Sora', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
  }
  .nf-chip.nf-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
  }
  .nf-chip:hover:not(.nf-active) {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
  }

  .topbar-avatar {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: white;
    cursor: pointer;
  }

  /* ─── MAIN ─── */
  .main {
    margin-left: var(--sidebar-w);
    margin-top: var(--header-h);
    padding: 24px;
    min-height: calc(100vh - var(--header-h));
    transition: margin-left .35s cubic-bezier(.4,0,.2,1);
  }

  .page-header {
    margin-bottom: 24px;
  }
  .page-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
  }
  .page-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
  }

  /* ─── KPI CARDS ─── */
  .kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
  }

  .kpi-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    cursor: default;
  }
  .kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

  .kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent, var(--primary));
  }

  .kpi-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--accent-bg, var(--primary-light));
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
  }

  .kpi-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    font-family: 'DM Mono', monospace;
  }

  .kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
  }

  .kpi-delta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
    padding: 2px 7px;
    border-radius: 20px;
    font-family: 'DM Mono', monospace;
  }
  .kpi-delta.up { background: rgba(0,196,140,.12); color: var(--green); }
  .kpi-delta.down { background: rgba(255,77,106,.12); color: var(--red); }
  .kpi-delta.neutral { background: var(--primary-light); color: var(--primary); }

  /* ─── GRID LAYOUT ─── */
  .dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 16px;
  }

  .card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
  }

  .card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: flex; align-items: center; gap: 8px;
  }

  .card-title .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: pulse-dot 2s infinite;
  }

  .card-action {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--primary-light);
    transition: all .2s;
  }
  .card-action:hover { background: var(--primary); color: white; }

  /* Chart */
  .chart-container {
    padding: 20px;
  }

  .chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 140px;
    margin-top: 12px;
  }

  .bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
    justify-content: flex-end;
  }

  .bar {
    width: 100%;
    border-radius: 6px 6px 0 0;
    background: var(--primary-light);
    position: relative;
    transition: all .3s;
    cursor: pointer;
    min-height: 4px;
  }
  .bar:hover { background: var(--primary); }
  .bar.active { background: var(--primary); }

  .bar-label {
    font-size: 9px;
    color: var(--text-light);
    font-family: 'DM Mono', monospace;
    white-space: nowrap;
  }

  .bar-val {
    font-size: 9px;
    font-weight: 700;
    color: var(--primary);
    font-family: 'DM Mono', monospace;
    opacity: 0;
    transition: opacity .2s;
    line-height: 1;
    margin-bottom: 2px;
  }
  .bar-col:hover .bar-val { opacity: 1; }
  .bar-col.has-val .bar-val { opacity: 1; }

  .filter-btn {
    padding: 5px 10px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    font-family: 'Sora', sans-serif;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
  }
  .filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
  }
  .active-filter {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
  }

  .cmdes-stats-row {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
  }
  .cmdes-stat-item {
    flex: 1;
    padding: 10px 14px;
    text-align: center;
    border-right: 1px solid var(--border);
  }
  .cmdes-stat-item:last-child { border-right: none; }
  .cmdes-stat-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    font-family: 'DM Mono', monospace;
    line-height: 1;
  }
  .cmdes-stat-label {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-top: 3px;
  }
  .cmdes-stat-delta {
    font-size: 10px;
    font-weight: 700;
    font-family: 'DM Mono', monospace;
    color: var(--green);
    margin-top: 2px;
  }

  .chart-grid-wrap {
    position: relative;
    height: 160px;
    margin-top: 8px;
  }
  .chart-grid-lines {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
  }
  .chart-grid-line {
    width: 100%;
    height: 1px;
    background: var(--border);
    opacity: .6;
  }
  .chart-bars-inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    gap: 5px;
    padding: 0 2px;
  }

  /* Metric row */
  .metric-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    transition: background .2s;
    cursor: default;
  }
  .metric-row:last-child { border-bottom: none; }
  .metric-row:hover { background: var(--bg); }

  .metric-icon {
    width: 36px; height: 36px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
  }

  .metric-info { flex: 1; min-width: 0; }
  .metric-name { font-size: 13px; font-weight: 500; color: var(--text); }
  .metric-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

  .metric-val {
    font-size: 15px;
    font-weight: 700;
    font-family: 'DM Mono', monospace;
    color: var(--text);
  }

  /* Status items */
  .status-list { padding: 8px 0; }
  .status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .2s;
  }
  .status-item:last-child { border-bottom: none; }
  .status-item:hover { background: var(--bg); }

  .status-avatar {
    width: 36px; height: 36px;
    border-radius: 9px;
    background: var(--primary-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: var(--primary);
    flex-shrink: 0;
  }

  .status-info { flex: 1; min-width: 0; }
  .status-name { font-size: 13px; font-weight: 500; color: var(--text); }
  .status-time { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

  .pill {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
  }
  .pill.pending { background: rgba(255,184,0,.15); color: var(--amber); }
  .pill.verified { background: rgba(0,196,140,.12); color: var(--green); }
  .pill.rejected { background: rgba(255,77,106,.12); color: var(--red); }
  .pill.blue { background: var(--primary-light); color: var(--primary); }

  /* IA Toggle */
  .ia-toggle-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(26,107,255,0.3);
    margin-bottom: 16px;
  }

  .ia-info h3 { font-size: 15px; font-weight: 600; }
  .ia-info p { font-size: 11px; opacity: .75; margin-top: 2px; }

  .toggle-switch {
    width: 48px; height: 26px;
    background: rgba(255,255,255,.25);
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: background .3s;
    flex-shrink: 0;
  }
  .toggle-switch.on { background: var(--green); }
  .toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    background: white;
    border-radius: 50%;
    top: 3px; left: 3px;
    transition: left .3s;
    box-shadow: 0 2px 4px rgba(0,0,0,.2);
  }
  .toggle-switch.on::after { left: 25px; }

  /* Sidebar overlay */
  .overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(13,27,62,.4);
    z-index: 99;
    backdrop-filter: blur(2px);
  }

  /* Animations */
  @keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .6; transform: scale(.85); }
  }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .kpi-card { animation: fadeUp .4s ease both; }
  .kpi-card:nth-child(1) { animation-delay: .05s; }
  .kpi-card:nth-child(2) { animation-delay: .10s; }
  .kpi-card:nth-child(3) { animation-delay: .15s; }
  .kpi-card:nth-child(4) { animation-delay: .20s; }
  .kpi-card:nth-child(5) { animation-delay: .25s; }

  /* ─── RESPONSIVE ─── */
  @media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
  }

  @media (max-width: 768px) {
    .sidebar {
      transform: translateX(-100%);
    }
    .sidebar.open { transform: translateX(0); }

    .topbar { left: 0; }
    .main { margin-left: 0; padding: 16px; }

    .hamburger { display: flex; }
    .overlay { display: block; opacity: 0; pointer-events: none; transition: opacity .3s; }
    .overlay.show { opacity: 1; pointer-events: all; }

    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .kpi-value { font-size: 22px; }

    .topbar-title { font-size: 14px; }
  }

@media (max-width: 420px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .main { padding: 12px; }
  }
/* ── TABLE PRODUITS : ligne compacte mobile ── */
  @media (max-width: 768px) {
    .pf-table-wrap {
      background: var(--white);
      border-radius: var(--radius);
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
      overflow: hidden;
      width: 100%;
      box-sizing: border-box;
    }
    .pf-table {
      width: 100%;
      border-collapse: collapse;
      table-layout: fixed;
      box-sizing: border-box;
    }
    .pf-table thead th { display: none; }
.pf-table thead th:nth-child(1)  { display: table-cell; width: 32px; }
    .pf-table thead th:nth-child(2)  { display: table-cell; }
    .pf-table thead th:nth-child(9)  { display: table-cell; width: 88px; }
    .pf-table thead th:nth-child(10) { display: table-cell; width: 96px; }
    .pf-table thead tr {
      background: var(--primary-light);
      border-bottom: 1px solid rgba(26,107,255,0.18);
    }
    .pf-table thead th {
      padding: 8px 6px;
      font-size: 9px;
      font-weight: 700;
      color: var(--primary);
      text-transform: uppercase;
      letter-spacing: .4px;
      font-family: 'Sora', sans-serif;
      white-space: nowrap;
      overflow: hidden;
    }
    .pf-table tbody tr {
      border-bottom: 1.5px solid rgba(13,27,62,0.1);
      background: var(--white);
    }
    .pf-table tbody tr:last-child { border-bottom: none; }
    .pf-table tbody tr:hover { background: var(--bg); }
    .pf-table tbody td {
      display: none;
      padding: 9px 6px;
      border: none;
      vertical-align: middle;
      overflow: hidden;
    }
    .pf-table tbody td:nth-child(1) {
      display: table-cell;
      text-align: center;
    }
    .pf-table tbody td:nth-child(2) { display: table-cell; }
.pf-prod-name {
      font-size: 13.5px;
      font-weight: 800;
      color: #0A0F1E;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      display: block;
      max-width: 100%;
      letter-spacing: -.2px;
      -webkit-font-smoothing: antialiased;
    }
    .pf-prod-ref { display: none; }
    .pf-table tbody td:nth-child(3),
    .pf-table tbody td:nth-child(4),
    .pf-table tbody td:nth-child(5),
    .pf-table tbody td:nth-child(6),
    .pf-table tbody td:nth-child(7),
    .pf-table tbody td:nth-child(8) { display: none; }
    .pf-table tbody td:nth-child(9) {
      display: table-cell;
      text-align: center;
    }
.pf-price {
      font-family: 'DM Mono', monospace;
      font-size: 10px;
      font-weight: 700;
      color: var(--green);
      white-space: nowrap;
      display: inline-block;
    }
.pf-table tbody td:nth-child(10) {
      display: table-cell;
      text-align: center;
      white-space: nowrap;
      padding: 9px 0;
    }
    .pf-table tbody td:nth-child(10) .pf-action-btn {
      width: 26px;
      height: 26px;
      display: inline-flex;
      margin: 0 2px;
      flex-shrink: 0;
      padding: 0;
    }
  }

  /* ─── QUICK ACTIONS STRIP ─── */
  .qa-strip {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 10px;
    margin-bottom: 20px;
  }
  .qa-strip::-webkit-scrollbar { display: none; }

  .qa-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
    width: 76px;
    padding: 10px 6px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform .18s, box-shadow .18s, border-color .18s;
    text-decoration: none;
  }
  .qa-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
  }
  .qa-btn:active { transform: scale(0.96); }

  .qa-icon {
    width: 34px; height: 34px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
  }

  .qa-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    letter-spacing: .1px;
  }
  .qa-sub {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 400;
    white-space: nowrap;
  }
  /* ─── KPI SCROLL STRIP ─── */
  .kpi-scroll-strip {
    display: flex;
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 14px;
    margin-bottom: 20px;
  }
  .kpi-scroll-strip::-webkit-scrollbar { display: none; }

  .kpi-chip {
    flex-shrink: 0;
    width: 148px;
    min-width: 148px;
    max-width: 200px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 3px;
    cursor: default;
    transition: transform .18s, box-shadow .18s;
    overflow: hidden;
  }
  .kpi-chip:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }

  .kpi-chip-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
  }

  .kpi-chip-icon {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }

  .kpi-chip-delta {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 20px;
    font-family: 'DM Mono', monospace;
    white-space: nowrap;
  }
  .kpi-chip-delta.up     { background: rgba(0,196,140,.12); color: #00C48C; }
  .kpi-chip-delta.down   { background: rgba(255,77,106,.12); color: #FF4D6A; }
  .kpi-chip-delta.neutral{ background: var(--primary-light); color: var(--primary); }

  .kpi-chip-val {
    font-size: clamp(11px, 3.2vw, 20px);
    font-weight: 700;
    color: var(--text);
    font-family: 'DM Mono', monospace;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    width: 100%;
  }

  .kpi-chip-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 6px;
  }

  .kpi-chip-bar {
    height: 3px;
    background: var(--surface2);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 2px;
  }

  .kpi-chip-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width .5s ease;
  }
  /* ─── GRAPHIQUES PROFESSIONNELS ─── */
  .charts-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
  }

  .chart-pro-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .chart-pro-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--border);
    gap: 10px;
  }

  .chart-pro-title-block { flex: 1; min-width: 0; }

  .chart-pro-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .chart-pro-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse-dot 2s infinite;
  }

  .chart-pro-subtitle {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 400;
  }

  .chart-pro-legends {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
  }

  .legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
  }

  .legend-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .chart-pro-stats {
    display: flex;
    gap: 16px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
  }

  .chart-stat-item { flex: 1; }

  .chart-stat-val {
    font-size: 16px;
    font-weight: 700;
    font-family: 'DM Mono', monospace;
    color: var(--text);
    line-height: 1;
  }

  .chart-stat-label {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: .5px;
  }

  .chart-stat-delta {
    font-size: 10px;
    font-weight: 700;
    margin-top: 1px;
    font-family: 'DM Mono', monospace;
  }
  .chart-stat-delta.up { color: #00C48C; }
  .chart-stat-delta.down { color: #FF4D6A; }

  .chart-pro-body {
    padding: 14px 18px 16px;
    position: relative;
  }

  .chart-pro-y-labels {
    position: absolute;
    left: 18px;
    top: 14px;
    bottom: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .chart-pro-y-label {
    font-size: 9px;
    color: var(--text-light);
    font-family: 'DM Mono', monospace;
    line-height: 1;
  }

  .chart-pro-wrap {
    margin-left: 36px;
    position: relative;
  }

  .chart-pro-svg {
    width: 100%;
    display: block;
    overflow: visible;
  }

  .chart-pro-x-labels {
    display: flex;
    justify-content: space-between;
    margin-left: 0;
    margin-top: 6px;
  }

  .chart-pro-x-label {
    font-size: 9px;
    color: var(--text-light);
    font-family: 'DM Mono', monospace;
    text-align: center;
    flex: 1;
  }

  .chart-tooltip {
    position: absolute;
    background: var(--text);
    color: white;
    font-size: 10px;
    font-family: 'DM Mono', monospace;
    padding: 5px 9px;
    border-radius: 7px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
    opacity: 0;
    transition: opacity .15s;
    transform: translate(-50%, -130%);
  }
  .chart-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px; left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom: none;
    border-top-color: var(--text);
  }
  /* ══════════════════════════════════════
     SECTION PRODUITS ACHETÉS
  ══════════════════════════════════════ */
  .section-page { display: none; }
  .section-page.active { display: block; }

  /* ── TOOLBAR produits achetés ── */
  .pf-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: var(--shadow);
  }
  .pf-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
  }
  .pf-search-bar svg { flex-shrink: 0; color: var(--text-light); }
  .pf-search-bar input {
    border: none; outline: none;
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    color: var(--text);
    background: transparent;
    width: 100%;
    min-width: 0;
  }
  .pf-search-bar input::placeholder { color: var(--text-light); }
  .pf-toolbar-divider {
    width: 1px;
    height: 22px;
    background: var(--border);
    flex-shrink: 0;
  }
  .btn-primary-pf {
    display: flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: white;
    border: none;
    border-radius: 9px;
    padding: 0 14px;
    height: 34px;
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(26,107,255,0.28);
    transition: opacity .2s, transform .1s;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .btn-primary-pf:hover { opacity: .92; }
  .btn-primary-pf:active { transform: scale(0.97); }

  /* Filtres catégorie — scroll horizontal une seule ligne */
  .pf-filters {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 14px;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  /* ── Bouton filtre toolbar ── */
  .pf-filter-btn {
    position: relative;
    width: 34px; height: 34px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all .18s;
  }
  .pf-filter-btn:hover,
  .pf-filter-btn.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
  }
  .pf-filter-badge {
    position: absolute;
    top: 4px; right: 4px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--red);
    border: 1.5px solid var(--white);
  }
  /* ── Drawer filtre ── */
  .pf-filter-drawer {
    display: none;
    flex-direction: column;
    gap: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(26,107,255,0.1);
    padding: 14px 14px 10px;
    margin-bottom: 14px;
    animation: pfFdIn .18s ease;
  }
  .pf-filter-drawer.open { display: flex; }
  @keyframes pfFdIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .pf-fd-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 6px 0;
  }
  .pf-fd-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-light);
    font-family: 'Sora', sans-serif;
  }
  .pf-fd-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .pf-fd-chip {
    padding: 4px 11px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    font-family: 'Sora', sans-serif;
    transition: all .15s;
    white-space: nowrap;
  }
  .pf-fd-chip.active,
  .pf-fd-chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
  }
  .pf-fd-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .pf-fd-input {
    flex: 1;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 10px;
    font-size: 12px;
    font-family: 'DM Mono', monospace;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: border-color .15s;
    min-width: 0;
  }
  .pf-fd-input:focus { border-color: var(--primary); }
  .pf-fd-price-sep {
    font-size: 12px;
    color: var(--text-light);
    flex-shrink: 0;
  }
  .pf-fd-sep {
    height: 1px;
    background: var(--border);
    margin: 2px 0;
  }
  .pf-fd-reset {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 6px 0 2px;
    background: none;
    border: none;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    font-family: 'Sora', sans-serif;
    transition: color .15s;
    align-self: flex-start;
  }
  .pf-fd-reset:hover { color: var(--red); }
  .pf-filters::-webkit-scrollbar { display: none; }
  .pf-filter-chip {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--white);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .18s;
    font-family: 'Sora', sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .pf-filter-chip.active,
  .pf-filter-chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
  }

  /* Pas de header page pour produits achetés — on garde juste le titre compact */
  #section-produitsFinis .page-header {
    margin-bottom: 14px;
  }
#section-produitsFinis .page-header h4 {
    font-size: 20px;
    color: #ffffff !important;
  }
  #section-produitsFinis .page-header p {
    font-size: 12px;
  }

  /* ── CARTES MOBILES produits achetés ── */
  /* ── LISTE COMPACTE produits achetés (mobile + desktop) ── */
  .pf-row-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: transparent;
    padding: 4px 0;
  }
/* ── Header tableau mobile ── */
  .pf-row-header {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 6px 12px;
    background: var(--primary-light);
    border: 1px solid rgba(26,107,255,0.2);
    border-radius: 10px;
    margin-bottom: 4px;
  }
  .pf-rh-num {
    width: 32px;
    font-size: 9.5px; font-weight: 700;
    color: var(--primary);
    text-align: center;
    flex-shrink: 0;
    font-family: 'DM Mono', monospace;
    letter-spacing: .5px;
    text-transform: uppercase;
  }
  .pf-rh-name {
    flex: 1;
    font-size: 9.5px; font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .5px;
    font-family: 'Sora', sans-serif;
    min-width: 0;
    padding-left: 2px;
  }
  .pf-rh-price {
    width: 90px;
    font-size: 9.5px; font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .5px;
    font-family: 'Sora', sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: center;
  }
  .pf-rh-actions {
    width: 96px;
    font-size: 9.5px; font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .5px;
    font-family: 'Sora', sans-serif;
    flex-shrink: 0;
    text-align: center;
  }
  /* ── Lignes mobiles ── */
  .pf-row-item {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 10px 12px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(26,107,255,0.06);
    transition: all .15s;
  }
  .pf-row-item:hover {
    border-color: rgba(26,107,255,0.25);
    box-shadow: 0 3px 12px rgba(26,107,255,0.1);
    transform: translateY(-1px);
  }
.pf-row-num {
    width: 32px; height: 26px;
    border-radius: 7px;
    background: var(--primary-light);
    border: 1px solid rgba(26,107,255,0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    color: var(--primary);
    font-family: 'DM Mono', monospace;
    flex-shrink: 0;
  }
  .pf-table tbody td:nth-child(1) .pf-row-num {
    width: auto; height: auto;
    background: none;
    border: none;
    border-radius: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
    display: inline;
  }
  .pf-row-name {
    flex: 1;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    letter-spacing: -.1px;
    padding-left: 8px;
  }
.pf-row-price {
    width: 90px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 3px 6px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: center;
  }
.mp-row-stock.pf-row-price {
    background: transparent;
    border-radius: 0;
    padding: 0;
    color: #00C48C;
    font-weight: 800;
    font-size: 13px;
  }
  .pf-row-actions {
    width: 96px;
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    justify-content: center;
    align-items: center;
  }
  .pf-btn-voir {
    height: 26px;
    padding: 0 9px;
    border-radius: 7px;
    border: 1px solid var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font-size: 10.5px;
    font-weight: 700;
    font-family: 'Sora', sans-serif;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
  }
  .pf-btn-voir:hover { background: var(--primary); color: white; }
/* Liste mobile cachée — tableau desktop utilisé partout */
  .pf-row-list { display: none !important; }
  /* ── SKELETON LOADING Produits (Catalogue) ── */
@keyframes pf-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.pf-sk {
  border-radius: 6px;
  background: linear-gradient(90deg, #eef3ff 25%, #dde6ff 50%, #eef3ff 75%);
  background-size: 800px 100%;
  animation: pf-shimmer 1.4s infinite linear;
  flex-shrink: 0;
}
/* ── Skeleton lignes tableau ── */
.pf-sk-tr td {
  padding: 10px 6px;
  border-bottom: 1.5px solid rgba(13,27,62,0.1);
  vertical-align: middle;
}
.pf-sk-tr:last-child td { border-bottom: none; }
.pf-sk-num-cell {
  width: 22px; height: 22px;
  border-radius: 6px;
  margin: 0 auto;
}
.pf-sk-name-cell {
  height: 13px;
  border-radius: 5px;
  width: 85%;
}
.pf-sk-price-cell {
  height: 12px;
  border-radius: 5px;
  width: 70px;
  margin: 0 auto;
}
.pf-sk-actions-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.pf-sk-btn {
  width: 24px; height: 24px;
  border-radius: 7px;
}
/* Legacy — conservé pour compatibilité */
.pf-skeleton-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pf-sk-num   { width: 26px; height: 26px; border-radius: 7px; }
.pf-sk-name  { flex: 1; height: 14px; border-radius: 5px; min-width: 60px; }
.pf-sk-badge { width: 72px; height: 22px; border-radius: 20px; }
.pf-sk-voir  { width: 46px; height: 28px; border-radius: 8px; }
.pf-sk-icon  { width: 26px; height: 26px; border-radius: 7px; }
  /* Modal détail produit */
  .pf-detail-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(13,27,62,.45);
    backdrop-filter: blur(4px);
    z-index: 400;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }
  .pf-detail-overlay.show { display: flex; }
  .pf-detail-box {
    background: var(--white);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 -8px 40px rgba(26,107,255,.18);
    animation: slideUp .28s cubic-bezier(.4,0,.2,1);
  }
  @keyframes slideUp {
    from { transform: translateY(60px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
  .pf-detail-box::-webkit-scrollbar { width: 4px; }
  .pf-detail-box::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
  .pf-detail-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0;
    background: var(--white);
    z-index: 1;
    border-radius: 20px 20px 0 0;
  }
  .pf-detail-head h3 {
    font-size: 15px; font-weight: 700; color: var(--text);
    display: flex; align-items: center; gap: 8px;
  }
.pf-detail-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 14px; }
  .pf-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .pf-detail-grid-full {
    grid-column: 1 / -1;
  }
  .pf-detail-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px 14px;
    background: var(--bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: box-shadow .15s;
  }
  .pf-detail-row:hover { box-shadow: 0 2px 12px rgba(26,107,255,.08); }
  .pf-detail-lbl {
    font-size: 10px; font-weight: 700; color: var(--text-light);
    text-transform: uppercase; letter-spacing: .8px;
    display: flex; align-items: center; gap: 5px;
  }
  .pf-detail-val {
    font-size: 14px; font-weight: 600; color: var(--text);
    word-break: break-word; line-height: 1.4;
  }
.pf-detail-dims-strip {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--primary-light), rgba(124,92,252,.07));
    border: 1.5px solid var(--primary);
    border-radius: 12px;
    padding: 11px 8px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    gap: 0;
    overflow: hidden;
  }
  .pf-detail-dims-strip-cell {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0 6px;
  }
  .pf-detail-dims-strip-cell + .pf-detail-dims-strip-cell {
    border-left: 1px solid var(--border);
  }
  .pf-detail-dims-strip-lbl {
    font-size: 9px; font-weight: 700; color: var(--text-light);
    text-transform: uppercase; letter-spacing: .6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 100%;
  }
  .pf-detail-dims-strip-val {
    font-size: 13px; font-weight: 700; color: var(--primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 100%; text-align: center;
  }
  .pf-detail-dims-strip-surf {
    font-size: 12px; font-weight: 800; color: var(--purple);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 100%; text-align: center;
  }
  .pf-detail-dims-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex; flex-direction: column; gap: 8px;
  }
  .pf-detail-dims-title {
    font-size: 10px; font-weight: 700; color: var(--text-light);
    text-transform: uppercase; letter-spacing: .8px;
    margin-bottom: 2px;
  }
  .pf-detail-dim-row {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--white); border-radius: 8px;
    padding: 8px 12px; border: 1px solid var(--border);
    font-size: 13px; font-weight: 600; color: var(--text);
  }
  .pf-detail-dim-label {
    color: var(--text-muted); font-size: 12px; font-weight: 500;
  }
  .pf-detail-dim-val {
    color: var(--primary); font-weight: 700;
  }
  .pf-detail-dims-total {
    font-size: 12px; font-weight: 700; color: var(--primary);
    text-align: right; margin-top: 2px;
  }
  .pf-detail-footer {
    display: flex; gap: 10px;
    padding: 14px 18px 22px;
    border-top: 1px solid var(--border);
  }
  .pf-detail-footer button { flex: 1; height: 44px; border-radius: 12px; font-family: 'Sora',sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; transition: all .18s; border: none; display: flex; align-items: center; justify-content: center; gap: 6px; }
  .pf-detail-btn-edit { background: linear-gradient(135deg,var(--primary),var(--purple)); color: white; box-shadow: 0 4px 14px rgba(26,107,255,.28); }
  .pf-detail-btn-edit:hover { opacity: .92; transform: translateY(-1px); }
  .pf-detail-btn-del  { background: rgba(255,77,106,.1); color: var(--red); }
  .pf-detail-btn-del:hover { background: rgba(255,77,106,.2); }

  /* Table produits */
  .pf-table-wrap {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .pf-table {
    width: 100%;
    border-collapse: collapse;
  }

  .pf-table thead th {
    background: var(--bg);
    padding: 11px 14px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .8px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }

  .pf-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .15s;
    cursor: default;
  }
  .pf-table tbody tr:last-child { border-bottom: none; }
  .pf-table tbody tr:hover { background: var(--bg); }

  .pf-table tbody td {
    padding: 11px 14px;
    font-size: 13px;
    color: var(--text);
    vertical-align: middle;
  }

  .pf-prod-name {
    font-weight: 600;
    color: var(--text);
    font-size: 13px;
  }
  .pf-prod-ref {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
    margin-top: 2px;
  }

  .pf-badge-cat {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
  }

  .pf-stock-ok   { color: var(--green); font-weight: 700; font-family: 'DM Mono', monospace; }
  .pf-stock-warn { color: var(--amber); font-weight: 700; font-family: 'DM Mono', monospace; }
  .pf-stock-crit { color: var(--red);   font-weight: 700; font-family: 'DM Mono', monospace; }

.pf-price {
    font-family: 'DM Mono', monospace;
    font-weight: 600;
    font-size: 13px;
    color: var(--green);
  }

  .pf-action-btn {
    width: 28px; height: 28px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px;
    transition: all .15s;
    margin-right: 3px;
  }
  .pf-action-btn:hover { border-color: var(--primary); background: var(--primary-light); }
  .pf-action-btn.del:hover { border-color: var(--red); background: rgba(255,77,106,.08); }

  .pf-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
  }
  .pf-empty-icon { font-size: 38px; margin-bottom: 10px; }
  .pf-empty p { font-size: 13px; font-weight: 500; }
  .pf-empty span { font-size: 12px; color: var(--text-light); }

  /* ── MODAL AJOUT PRODUIT ── */
  .modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(13,27,62,.45);
    backdrop-filter: blur(4px);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 16px;
  }
  .modal-overlay.show { display: flex; }

  .modal-box {
    background: var(--white);
    border-radius: 18px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,.18);
    animation: fadeUp .25s ease;
  }
  .modal-box::-webkit-scrollbar { width: 4px; }
  .modal-box::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

  .modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0;
    background: var(--white);
    z-index: 1;
    border-radius: 18px 18px 0 0;
  }
  .modal-head h3 {
    font-size: 15px; font-weight: 700; color: var(--text);
    display: flex; align-items: center; gap: 8px;
  }
  .modal-close {
    width: 30px; height: 30px;
    border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: var(--text-muted);
    transition: all .15s;
  }
  .modal-close:hover { background: rgba(255,77,106,.08); border-color: var(--red); color: var(--red); }

  .modal-body { padding: 20px 22px 24px; }

  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
  }
  .form-row.full { grid-template-columns: 1fr; }

  .form-group { display: flex; flex-direction: column; gap: 5px; }

  .form-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .7px;
  }

  .form-input, .form-select {
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    color: var(--text);
    background: var(--white);
    outline: none;
    transition: border .2s;
    width: 100%;
    box-sizing: border-box;
  }
  .form-input:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,107,255,.08);
  }
  .form-textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    color: var(--text);
    background: var(--white);
    outline: none;
    transition: border .2s;
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 70px;
  }
  .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,107,255,.08);
  }

  /* Catégorie libre */
  .pf-cat-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .pf-cat-custom {
    font-size: 12px !important;
  }

  .modal-footer {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    border-radius: 0 0 18px 18px;
    position: sticky; bottom: 0;
  }
  .btn-cancel {
    padding: 0 18px; height: 36px;
    border: 1px solid var(--border);
    border-radius: 9px; background: var(--white);
    font-family: 'Sora', sans-serif; font-size: 13px;
    font-weight: 600; color: var(--text-muted);
    cursor: pointer; transition: all .15s;
  }
  .btn-cancel:hover { border-color: var(--red); color: var(--red); }
  .btn-save {
    padding: 0 22px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border: none; border-radius: 9px; color: white;
    font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 700;
    cursor: pointer; box-shadow: 0 4px 12px rgba(26,107,255,.3);
    transition: opacity .2s, transform .1s;
  }
  .btn-save:hover { opacity: .92; }
  .btn-save:active { transform: scale(0.97); }
  .btn-save:disabled { opacity: .5; cursor: wait; }
  /* ─── MODAL HEAD PREMIUM ─── */
  #modalProduit .modal-head {
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    border-bottom: none;
    border-radius: 18px 18px 0 0;
    padding: 22px 22px 20px;
    position: relative;
    overflow: hidden;
  }
  #modalProduit .modal-head::before {
    content: '';
    position: absolute;
    top: -20px; right: -20px;
    width: 90px; height: 90px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
  }
  #modalProduit .modal-head::after {
    content: '';
    position: absolute;
    bottom: -30px; right: 50px;
    width: 60px; height: 60px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
  }
  #modalProduit .modal-head h3 {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    gap: 10px;
  }
  #modalProduit .modal-head h3 .mh-icon {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.18);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  #modalProduit .modal-head h3 .mh-text { display: flex; flex-direction: column; gap: 2px; }
  #modalProduit .modal-head h3 .mh-sub {
    font-size: 11px;
    font-weight: 400;
    color: rgba(255,255,255,0.7);
    letter-spacing: .2px;
  }
  #modalProduit .modal-close {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: white;
    backdrop-filter: blur(4px);
  }
  #modalProduit .modal-close:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.4);
    color: white;
  }
  #modalProduit .modal-body {
    padding: 22px 22px 8px;
  }
  #modalProduit .form-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: .8px;
  }
  #modalProduit .form-input,
  #modalProduit .form-select {
    border-radius: 10px;
    height: 40px;
    font-size: 13.5px;
    background: var(--bg);
    border-color: var(--border);
  }
  #modalProduit .form-input:focus,
  #modalProduit .form-select:focus {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,107,255,0.1);
  }
  #modalProduit .modal-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 16px 22px;
    gap: 10px;
  }
  #modalProduit .btn-cancel {
    flex: 1;
    height: 42px;
    border-radius: 11px;
  }
  #modalProduit .btn-save {
    flex: 2;
    height: 42px;
    border-radius: 11px;
    font-size: 14px;
    letter-spacing: .2px;
    box-shadow: 0 6px 16px rgba(26,107,255,0.35);
  }

  /* Toast notification */
  .pf-toast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--text); color: white;
    padding: 12px 18px; border-radius: 10px;
    font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    z-index: 9999; display: none;
    animation: fadeUp .25s ease;
  }
  .pf-toast.show { display: block; }
  .pf-toast.success { background: var(--green); }
  .pf-toast.error   { background: var(--red); }
  /* ══════════════════════════════
   MATIÈRES PREMIÈRES
══════════════════════════════ */
.mp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.mp-search-bar {
  flex: 1;
  min-width: 160px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  height: 38px;
  box-shadow: var(--shadow);
}
.mp-search-bar input {
  flex: 1; border: none; outline: none;
  font-family: 'Sora', sans-serif;
  font-size: 13px; color: var(--text);
  background: transparent;
}
.btn-primary-mp {
  display: flex; align-items: center; gap: 6px;
  padding: 0 16px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border: none; border-radius: var(--radius-sm);
  color: white; font-family: 'Sora', sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(26,107,255,.28);
  transition: opacity .2s;
}
.btn-primary-mp:hover { opacity: .9; }

/* Liste produits MP */
/* ── Liste compacte achats MP ── */
.mp-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0;
}
/* ── Header colonnes Stock MP ── */
.mp-row-header {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  margin-bottom: 0;
}
.mp-rh-num {
  width: 32px;
  font-size: 9.5px; font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
  font-family: 'DM Mono', monospace;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.mp-rh-name {
  flex: 1;
  font-size: 9.5px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-family: 'Sora', sans-serif;
  padding-left: 10px;
}
.mp-rh-stock {
  width: 110px;
  font-size: 9.5px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-family: 'Sora', sans-serif;
  flex-shrink: 0;
  text-align: center;
}
.mp-rh-actions {
  width: 96px;
  font-size: 9.5px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-family: 'Sora', sans-serif;
  flex-shrink: 0;
  text-align: center;
}
/* ── Lignes Stock MP ── */
.mp-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 13px 12px;
  background: var(--white);
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  transition: background .15s;
}
.mp-row:last-child { border-bottom: none; }
.mp-row:hover { background: var(--bg); }
.mp-row-num {
  width: 32px; height: 26px;
  border-radius: 0;
  background: transparent;
  border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 400;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  flex-shrink: 0;
}
.mp-row-name {
  flex: 1; min-width: 0;
  font-size: 15px; font-weight: 800;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -.2px;
  padding-left: 8px;
}
.mp-row-stock {
  width: 110px;
  flex-shrink: 0;
  text-align: center;
}
.mp-row-actions {
  width: 96px;
  display: flex; gap: 4px;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
}
/* ── SKELETON LOADING Matières premières ── */
@keyframes mp-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.mp-skeleton-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 6px rgba(26,107,255,0.05);
}
.mp-sk {
  border-radius: 6px;
  background: linear-gradient(90deg, #eef3ff 25%, #dde6ff 50%, #eef3ff 75%);
  background-size: 800px 100%;
  animation: mp-shimmer 1.4s infinite linear;
  flex-shrink: 0;
}
.mp-sk-num   { width: 26px; height: 26px; border-radius: 7px; }
.mp-sk-name  { flex: 1; height: 14px; border-radius: 5px; min-width: 60px; }
.mp-sk-badge { width: 72px; height: 22px; border-radius: 20px; }
.mp-sk-voir  { width: 46px; height: 28px; border-radius: 8px; }
.mp-sk-icon  { width: 26px; height: 26px; border-radius: 7px; }
/* Panneau détail produit MP */
.mp-detail-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(13,27,62,.45);
  z-index: 500;
  backdrop-filter: blur(3px);
  align-items: flex-end;
  justify-content: center;
}
.mp-detail-overlay.show { display: flex; }

.mp-detail-panel {
  background: var(--white);
  border-radius: 20px 20px 0 0;
  width: 100%; max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 0 0 32px;
  box-shadow: 0 -8px 40px rgba(13,27,62,.18);
  animation: slideUp .28s cubic-bezier(.4,0,.2,1);
}
@keyframes slideUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.mp-panel-handle {
  display: flex; justify-content: center; padding: 12px 0 8px;
}
.mp-panel-handle::before {
  content: '';
  width: 36px; height: 4px;
  border-radius: 99px;
  background: var(--border);
}

.mp-panel-head {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 20px 14px;
  border-bottom: 1px solid var(--border);
}
.mp-panel-title {
  font-size: 16px; font-weight: 700; color: var(--text);
}
.mp-panel-close {
  width: 30px; height: 30px;
  border-radius: 8px; border: none;
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.mp-panel-body { padding: 16px 16px 0; }

.mp-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.mp-info-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mp-info-item-icon {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-bottom: 1px;
}
.mp-info-label {
  font-size: 9.5px; font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase; letter-spacing: .7px;
}
.mp-info-value {
  font-size: clamp(11px, 3.2vw, 13.5px);
  font-weight: 700;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  line-height: 1.25;
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}
.mp-info-value.muted { color: var(--text-muted); font-size: clamp(10px, 2.8vw, 13px); font-family: 'Sora', sans-serif; font-weight: 500; word-break: break-word; overflow-wrap: break-word; }
.mp-info-item.accent {
  background: var(--primary-light);
  border-color: rgba(26,107,255,0.22);
}
.mp-info-item.accent .mp-info-value { color: var(--primary); font-size: clamp(11px, 3.2vw, 14px); }


.mp-info-item.accent .mp-info-item-icon { background: rgba(26,107,255,0.15); }
.mp-info-item.full { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 10px; }
.mp-info-item.full .mp-info-item-icon { flex-shrink: 0; }
.mp-info-item.full .mp-info-text { display: flex; flex-direction: column; gap: 2px; }
.mp-notes-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 13px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.mp-notes-box p {
  font-size: 13px; color: var(--text-muted);
  line-height: 1.5;
}



.mp-panel-actions {
  display: flex; gap: 8px;
  padding: 0 20px;
  margin-top: 18px;
}
.mp-btn-edit {
  flex: 1; height: 40px;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: 10px;
  color: var(--primary);
  font-family: 'Sora', sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.mp-btn-edit:hover { background: var(--primary); color: white; }
.mp-btn-del {
  height: 40px; padding: 0 16px;
  background: rgba(255,77,106,.1);
  border: 1px solid rgba(255,77,106,.3);
  border-radius: 10px;
  color: var(--red);
  font-family: 'Sora', sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; gap: 6px;
}
.mp-btn-del:hover { background: var(--red); color: white; }

/* Modal ajout/édition MP */
.mp-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(13,27,62,.5);
  z-index: 600;
  align-items: center; justify-content: center;
  padding: 12px;
  box-sizing: border-box;
}
.mp-modal-overlay.show { display: flex; }
.mp-modal-box {
  background: var(--white);
  border-radius: 18px;
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow-md);
  box-sizing: border-box;
}



.mp-modal-head {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 20px 20px 18px;
  border-bottom: none;
  position: sticky; top: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
  z-index: 1;
  border-radius: 18px 18px 0 0;
  overflow: hidden;
}
.mp-modal-head::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 90px; height: 90px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  pointer-events: none;
}
.mp-modal-head::after {
  content: '';
  position: absolute;
  bottom: -30px; right: 50px;
  width: 60px; height: 60px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  pointer-events: none;
}
.mp-modal-head h3 {
  font-size: 15px; font-weight: 700; color: #ffffff;
  display: flex; align-items: center; gap: 10px;
}
.mp-modal-head h3 svg { stroke: white; }
.mp-modal-close {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.15);
  color: white; font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  transition: all .15s;
  flex-shrink: 0;
}
.mp-modal-close:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
}


.mp-modal-body { padding: 12px 14px 6px; display: flex; flex-direction: column; gap: 7px; box-sizing: border-box; width: 100%; }
.mp-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; box-sizing: border-box; }
.mp-form-row.full { grid-template-columns: 1fr; }
.mp-form-group { display: flex; flex-direction: column; gap: 4px; min-width: 0; width: 100%; }
.mp-form-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
}
.mp-form-input, .mp-form-select, .mp-form-textarea {
  height: 34px; padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Sora', sans-serif;
  font-size: 12.5px; color: var(--text);
  background: var(--white);
  outline: none; transition: border .2s;
  width: 100%; box-sizing: border-box;
  min-width: 0;
}
.mp-form-input:focus,
.mp-form-select:focus { border-color: var(--primary); }
.mp-form-textarea {
  height: 72px; padding: 10px 12px;
  resize: none; line-height: 1.5;
}
.mp-modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 18px 18px;
  position: sticky; bottom: 0;
  box-sizing: border-box; width: 100%;
}

.mp-produit-info {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin: 2px 0 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.mp-produit-info::-webkit-scrollbar { display: none; }
.mp-info-chip {
  background: var(--primary-light);
  border: 1px solid rgba(26,107,255,0.18);
  border-radius: 10px;
  padding: 7px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
  min-width: 90px;
}
.mp-info-chip span {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-light);
  white-space: nowrap;
}
.mp-info-chip strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  font-family: 'DM Mono', monospace;
  white-space: nowrap;
}


/* Champ lecture seule */
.mp-readonly {
  background: var(--bg) !important;
  color: var(--primary) !important;
  font-family: 'DM Mono', monospace !important;
  font-weight: 700 !important;
  cursor: default !important;
}
/* Total calculé */
.mp-total-display {
  display: flex !important;
  align-items: center !important;
  background: var(--primary-light) !important;
  color: var(--primary) !important;
  font-weight: 700 !important;
  font-family: 'DM Mono', monospace !important;
  cursor: default !important;
  border-color: var(--primary) !important;
}

/* Toast MP */
.mp-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--text); color: white;
  padding: 10px 18px; border-radius: 10px;
  font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  z-index: 9999; display: none;
  animation: fadeUp .25s ease;
  white-space: nowrap;
}
.mp-toast.show  { display: block; }
.mp-toast.success { background: var(--green); }
.mp-toast.error   { background: var(--red); }

/* Empty state MP */
.mp-empty {
  text-align: center; padding: 40px 20px;
  color: var(--text-muted);
}
.mp-empty p { font-size: 14px; font-weight: 600; margin-top: 10px; }
.mp-empty span { font-size: 12px; }
/* ══════════════════════════════
   PERSONNEL RH
══════════════════════════════ */
.rh-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.rh-search-bar {
  flex: 1; min-width: 160px;
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 12px;
  height: 38px; box-shadow: var(--shadow);
}
.rh-search-bar input {
  flex: 1; border: none; outline: none;
  font-family: 'Sora', sans-serif; font-size: 13px;
  color: var(--text); background: transparent;
}
.btn-primary-rh {
  display: flex; align-items: center; gap: 6px;
  padding: 0 16px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border: none; border-radius: var(--radius-sm);
  color: white; font-family: 'Sora', sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(26,107,255,.28);
  transition: opacity .2s;
}
.btn-primary-rh:hover { opacity: .9; }

.rh-list { display: flex; flex-direction: column; gap: 10px; }

.rh-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow .2s, border-color .2s, transform .15s;
}
.rh-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.rh-avatar {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: white;
}
.rh-card-info { flex: 1; min-width: 0; }
.rh-card-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rh-card-meta {
  font-size: 11px; color: var(--text-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rh-card-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0;
}
.rh-contrat-badge {
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 20px; white-space: nowrap;
}
.rh-cdi  { background: rgba(0,196,140,.12); color: var(--green); }
.rh-cdd  { background: rgba(255,184,0,.15); color: var(--amber); }
.rh-inactif { background: rgba(160,176,204,.15); color: var(--text-light); }

.rh-poste-tag {
  font-size: 10px; color: var(--text-muted);
  font-family: 'DM Mono', monospace;
}

/* Panneau détail personnel */
.rh-detail-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(13,27,62,.45); z-index: 500;
  backdrop-filter: blur(3px);
  align-items: flex-end; justify-content: center;
}
.rh-detail-overlay.show { display: flex; }
.rh-detail-panel {
  background: var(--white);
  border-radius: 20px 20px 0 0;
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  padding: 0 0 32px;
  box-shadow: 0 -8px 40px rgba(13,27,62,.18);
  animation: slideUp .28s cubic-bezier(.4,0,.2,1);
}
.rh-panel-handle {
  display: flex; justify-content: center; padding: 12px 0 8px;
}
.rh-panel-handle::before {
  content: ''; width: 36px; height: 4px;
  border-radius: 99px; background: var(--border);
}
.rh-panel-head {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 20px 14px; border-bottom: 1px solid var(--border);
}
.rh-panel-title { font-size: 16px; font-weight: 700; color: var(--text); }
.rh-panel-close {
  width: 30px; height: 30px; border-radius: 8px; border: none;
  background: var(--surface2); color: var(--text-muted);
  font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.rh-panel-body { padding: 18px 20px 0; }
.rh-info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 14px;
}
.rh-info-item {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
}
.rh-info-label {
  font-size: 10px; font-weight: 600; color: var(--text-light);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px;
}
.rh-info-value {
  font-size: 13px; font-weight: 600; color: var(--text);
  word-break: break-word;
}
.rh-info-value.mono { font-family: 'DM Mono', monospace; font-size: 13px; }
.rh-info-value.muted { color: var(--text-muted); font-weight: 500; }

.rh-cred-box {
  background: linear-gradient(135deg, rgba(26,107,255,.07), rgba(124,92,252,.07));
  border: 1px solid var(--primary);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 14px;
}
.rh-cred-title {
  font-size: 11px; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.rh-cred-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; margin-bottom: 6px;
}
.rh-cred-row:last-child { margin-bottom: 0; }
.rh-cred-label { color: var(--text-muted); font-weight: 500; }
.rh-cred-val {
  font-family: 'DM Mono', monospace; font-weight: 700;
  color: var(--text); background: var(--white);
  padding: 3px 8px; border-radius: 6px;
  border: 1px solid var(--border); font-size: 12px;
}

.rh-panel-actions {
  display: flex; gap: 8px; padding: 0 20px; margin-top: 16px;
}
.rh-btn-edit {
  flex: 1; height: 40px;
  background: var(--primary-light); border: 1px solid var(--primary);
  border-radius: 10px; color: var(--primary);
  font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.rh-btn-edit:hover { background: var(--primary); color: white; }
.rh-btn-del {
  height: 40px; padding: 0 16px;
  background: rgba(255,77,106,.1); border: 1px solid rgba(255,77,106,.3);
  border-radius: 10px; color: var(--red);
  font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; gap: 6px;
}
.rh-btn-del:hover { background: var(--red); color: white; }

/* Modal Personnel */
.rh-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(13,27,62,.5); z-index: 600;
  align-items: center; justify-content: center;
  padding: 12px; box-sizing: border-box;
}
.rh-modal-overlay.show { display: flex; }
.rh-modal-box {
  background: var(--white); border-radius: 18px;
  width: 100%; max-width: 460px; max-height: 90vh;
  overflow-y: auto; overflow-x: hidden;
  box-shadow: var(--shadow-md); box-sizing: border-box;
}
.rh-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 14px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--white); z-index: 1;
}
.rh-modal-head h3 {
  font-size: 15px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.rh-modal-close {
  width: 28px; height: 28px; border-radius: 8px; border: none;
  background: var(--surface2); color: var(--text-muted); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.rh-modal-body {
  padding: 16px 16px 8px; display: flex; flex-direction: column;
  gap: 10px; box-sizing: border-box; width: 100%;
}
.rh-section-label {
  font-size: 10px; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: .8px;
  padding: 4px 0 2px; border-bottom: 1px solid var(--primary-light);
}
.rh-form-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; width: 100%; box-sizing: border-box;
}
.rh-form-row.full { grid-template-columns: 1fr; }
.rh-form-group {
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0; width: 100%;
}
.rh-form-label {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
}
.rh-form-input, .rh-form-select {
  height: 38px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: 'Sora', sans-serif; font-size: 13px; color: var(--text);
  background: var(--white); outline: none; transition: border .2s;
  width: 100%; box-sizing: border-box; min-width: 0;
}
.rh-form-input:focus, .rh-form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,107,255,.08);
}
.rh-compte-box {
  background: linear-gradient(135deg, rgba(26,107,255,.06), rgba(124,92,252,.06));
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 8px;
}
.rh-compte-toggle {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
}
.rh-compte-toggle-label {
  font-size: 13px; font-weight: 600; color: var(--text);
}
.rh-toggle-sw {
  width: 42px; height: 22px; background: var(--border);
  border-radius: 11px; position: relative; cursor: pointer;
  transition: background .3s; flex-shrink: 0;
}
.rh-toggle-sw.on { background: var(--primary); }
.rh-toggle-sw::after {
  content: ''; position: absolute;
  width: 16px; height: 16px; background: white;
  border-radius: 50%; top: 3px; left: 3px;
  transition: left .3s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.rh-toggle-sw.on::after { left: 23px; }
.rh-compte-fields { display: flex; flex-direction: column; gap: 8px; }

.rh-modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 16px; border-top: 1px solid var(--border);
  background: var(--bg); border-radius: 0 0 18px 18px;
  position: sticky; bottom: 0; box-sizing: border-box; width: 100%;
}

/* Toast RH */
.rh-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--text); color: white;
  padding: 10px 18px; border-radius: 10px;
  font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  z-index: 9999; display: none; animation: fadeUp .25s ease; white-space: nowrap;
}
.rh-toast.show { display: block; }
.rh-toast.success { background: var(--green); }
.rh-toast.error   { background: var(--red); }

.rh-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.rh-empty p { font-size: 14px; font-weight: 600; margin-top: 10px; }
.rh-empty span { font-size: 12px; }
/* ══════════════════════════════
   TABLEAU FOURNISSEURS COMPACT
══════════════════════════════ */
.frn-pro-wrap {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.frn-pro-table {
  width: 100%;
  border-collapse: collapse;
}
.frn-pro-table thead th {
  background: var(--bg);
  padding: 9px 12px;
  text-align: left;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .9px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.frn-pro-table thead th:first-child { width: 32px; text-align: center; }
.frn-pro-table thead th:last-child  { text-align: right; }
.frn-pro-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.frn-pro-table tbody tr:last-child { border-bottom: none; }
.frn-pro-table tbody tr:hover { background: var(--bg); }
.frn-pro-table tbody td {
  padding: 9px 12px;
  font-size: 12px;
  color: var(--text);
  vertical-align: middle;
}
/* Colonne # */
.frn-pro-table tbody td:first-child {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-light);
  font-family: 'DM Mono', monospace;
  width: 32px;
}
/* Nom entreprise + sous-nom */
.frn-pro-ent {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.frn-pro-sub {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
/* ══════════════════════════════════════════
   CLIENTS
══════════════════════════════════════════ */
.cli-pro-wrap { overflow-x:hidden; border-radius:var(--radius); border:1px solid var(--border); background:var(--white); box-shadow:var(--shadow); }
.cli-th-desktop, .cli-td-desktop { display:none; }
@media(min-width:640px){ .cli-th-desktop, .cli-td-desktop { display:table-cell; } }
.cli-pro-table { width:100%; border-collapse:collapse; font-size:13px; table-layout:fixed; }
.cli-pro-table thead th { padding:9px 10px; text-align:left; font-size:9.5px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.6px; border-bottom:1px solid var(--border); background:var(--bg); white-space:nowrap; overflow:hidden; }
.cli-td-num { width:28px; text-align:center; font-size:10px; font-weight:700; color:var(--text-muted); padding:0 4px !important; vertical-align:middle; }
.cli-td-avatar { width:44px; padding:8px 4px 8px 10px !important; vertical-align:middle; }
.cli-td-nom { min-width:0; overflow:hidden; padding:8px 6px !important; vertical-align:middle; }
.cli-td-nom .cli-nom-name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; max-width:100%; }
.cli-td-nom .cli-nom-sub  { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; max-width:100%; }
.cli-td-tel { width:85px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-family:'DM Mono',monospace; font-size:11px; color:var(--text-muted); font-weight:500; padding:8px 4px !important; vertical-align:middle; }
.cli-td-actions { width:96px; min-width:96px; text-align:right; white-space:nowrap; padding:6px 8px 6px 0 !important; vertical-align:middle; display:table-cell; }



.cli-pro-table tbody tr { border-bottom:1px solid var(--border); transition:background .15s; }
.cli-pro-table tbody tr:last-child { border-bottom:none; }
.cli-pro-table tbody tr:hover { background:var(--bg); }
.cli-pro-table tbody td { padding:10px 14px; color:var(--text); vertical-align:middle; }
.cli-pro-badge { display:inline-flex; align-items:center; gap:4px; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:600; white-space:nowrap; }
.cli-pro-badge.vip      { background:rgba(255,193,7,.15);  color:#c8860a; }
.cli-pro-badge.regulier { background:rgba(0,196,140,.12);  color:var(--green); }
.cli-pro-badge.nouveau  { background:var(--primary-light); color:var(--primary); }
.cli-pro-badge.inactif  { background:rgba(255,77,106,.1);  color:var(--red); }
.cli-pro-btn { width:26px; height:26px; border-radius:6px; border:1px solid var(--border); background:var(--bg); cursor:pointer; display:inline-flex; align-items:center; justify-content:center; color:var(--text-muted); transition:all .15s; flex-shrink:0; margin-left:2px; vertical-align:middle; }
.cli-pro-btn:hover { background:var(--primary-light); color:var(--primary); border-color:var(--primary); }
.cli-pro-btn.cli-del:hover { background:rgba(255,77,106,.1); color:var(--red); border-color:var(--red); }
/* Nom client tronqué — jamais de débordement */
.cli-nom-wrap { display:flex; align-items:center; gap:9px; min-width:0; }
.cli-avatar { width:32px; height:32px; border-radius:9px; background:linear-gradient(135deg,var(--primary),var(--purple)); display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; color:#fff; flex-shrink:0; font-family:'DM Mono',monospace; }
.cli-nom-text { min-width:0; }
.cli-nom-name { font-weight:700; color:var(--text); font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; display:block; }
.cli-nom-sub  { font-size:11px; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; display:block; margin-top:1px; }
/* Skeleton clients */
@keyframes cli-shimmer { 0%{background-position:-400px 0} 100%{background-position:400px 0} }
/* Skeleton KPI chips clients */
.cli-kpi-sk-strip { display:flex; flex-direction:row; gap:10px; overflow-x:auto; scrollbar-width:none; padding:4px 2px 14px; margin-bottom:20px; }
.cli-kpi-sk-strip::-webkit-scrollbar { display:none; }
.cli-kpi-sk-card { flex-shrink:0; width:148px; min-width:148px; background:var(--white); border:1px solid var(--border); border-radius:12px; padding:12px 14px; box-shadow:var(--shadow); display:flex; flex-direction:column; gap:3px; overflow:hidden; }
.cli-kpi-sk-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:4px; }
.cli-kpi-sk-icon { width:28px; height:28px; border-radius:8px; }
.cli-kpi-sk-badge { width:52px; height:18px; border-radius:20px; }
.cli-kpi-sk-val { width:40px; height:20px; border-radius:5px; margin-bottom:2px; }
.cli-kpi-sk-label { width:90px; height:10px; border-radius:4px; margin-bottom:6px; }
.cli-kpi-sk-bar { height:3px; border-radius:99px; width:100%; }
.cli-sk { border-radius:6px; background:linear-gradient(90deg,#eef3ff 25%,#dde6ff 50%,#eef3ff 75%); background-size:800px 100%; animation:cli-shimmer 1.4s infinite linear; flex-shrink:0; }
.cli-sk-row { display:flex; align-items:center; gap:10px; padding:10px 14px; border-bottom:1px solid var(--border); }
.cli-sk-avatar { width:32px; height:32px; border-radius:9px; }
.cli-sk-name   { height:13px; border-radius:5px; flex:1; }
.cli-sk-badge  { width:70px; height:22px; border-radius:20px; }
.cli-sk-actions{ width:90px; height:28px; border-radius:7px; }


/* Statut pill */
.frn-pill-actif {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 700;
  background: rgba(0,196,140,.12);
  color: var(--green);
  white-space: nowrap;
}
.frn-pill-inactif {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 700;
  background: rgba(160,176,204,.15);
  color: var(--text-light);
  white-space: nowrap;
}
/* Pays */
.frn-pro-pays {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: 'DM Mono', monospace;
}
/* Boutons actions */
.frn-pro-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.frn-pro-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.frn-pro-btn:hover         { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.frn-pro-btn.frn-del:hover { border-color: var(--red);     background: rgba(255,77,106,.08); color: var(--red); }
/* ── Mobile : cacher pays, réduire paddings ── */
@media (max-width: 768px) {
  .frn-col-pays { display: none; }
  .frn-pro-table thead th { padding: 8px 8px; font-size: 8px; }
  .frn-pro-table tbody td { padding: 8px 8px; }
  .frn-pro-ent  { max-width: 120px; font-size: 11px; }
  .frn-pro-sub  { max-width: 120px; font-size: 9px; }
  .frn-pro-btn  { width: 28px; height: 28px; }
  .frn-pro-actions { gap: 3px; }
  .frn-pro-table thead th:first-child { width: 24px; padding: 8px 4px; }
  .frn-pro-table tbody td:first-child { width: 24px; padding: 8px 4px; }
}
/* ══════════════════════════════
   ORDRES DE FABRICATION
══════════════════════════════ */
.of-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
}
.of-search-bar {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 0;
}
.of-search-bar input {
  border: none; outline: none;
  font-family: 'Sora', sans-serif; font-size: 13px;
  color: var(--text); background: transparent; width: 100%;
}
.of-table-wrap {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.of-table { width: 100%; border-collapse: collapse; }
.of-table thead th {
  background: var(--bg);
  padding: 9px 12px;
  text-align: left;
  font-size: 9px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .9px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.of-table thead th:first-child { width: 30px; text-align: center; }
.of-table thead th:last-child  { text-align: right; }
.of-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.of-table tbody tr:last-child { border-bottom: none; }
.of-table tbody tr:hover { background: var(--bg); }
.of-table tbody td {
  padding: 9px 12px; font-size: 12px;
  color: var(--text); vertical-align: middle;
}
.of-table tbody td:first-child {
  text-align: center; font-size: 10px; font-weight: 700;
  color: var(--text-light); font-family: 'DM Mono', monospace;
}
.of-nom { font-size: 12px; font-weight: 700; color: var(--text); }
.of-ref { font-size: 10px; color: var(--text-muted); font-family: 'DM Mono', monospace; margin-top: 1px; }
.of-prix { font-size: 12px; font-weight: 700; font-family: 'DM Mono', monospace; color: var(--primary); white-space: nowrap; }
.of-gain { font-size: 11px; font-weight: 600; font-family: 'DM Mono', monospace; color: var(--green); white-space: nowrap; }
.of-pill-brouillon { display:inline-block; padding:2px 8px; border-radius:20px; font-size:9px; font-weight:700; background:rgba(255,184,0,.15); color:var(--amber); }
.of-pill-actif     { display:inline-block; padding:2px 8px; border-radius:20px; font-size:9px; font-weight:700; background:rgba(0,196,140,.12); color:var(--green); }
.of-pill-archivé   { display:inline-block; padding:2px 8px; border-radius:20px; font-size:9px; font-weight:700; background:rgba(160,176,204,.15); color:var(--text-light); }
.of-col-desktop { display: table-cell; }
.of-mobile-meta { display: none; }
.of-actions { display:flex; gap:4px; justify-content:flex-end; }
.of-btn {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--white);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0; color: var(--text-muted);
}
.of-btn:hover      { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.of-btn.of-del:hover { border-color: var(--red); background: rgba(255,77,106,.08); color: var(--red); }
/* Modal OF */
.of-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(13,27,62,.55); backdrop-filter: blur(3px);
  z-index: 600; align-items: center; justify-content: center;
  padding: 12px; box-sizing: border-box;
}
.of-modal-overlay.show { display: flex; }
.of-modal-box {
  background: var(--white); border-radius: 20px;
  width: 100%; max-width: 540px; max-height: 92vh;
  overflow-y: auto; overflow-x: hidden;
  box-shadow: 0 24px 64px rgba(13,27,62,.22); box-sizing: border-box;
}
.of-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 18px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
  position: relative; overflow: hidden;
  border-radius: 20px 20px 0 0;
}
.of-modal-head::before {
  content:''; position:absolute; top:-30px; right:-30px;
  width:110px; height:110px; background:rgba(255,255,255,.07); border-radius:50%;
}
.of-modal-head::after {
  content:''; position:absolute; bottom:-35px; right:55px;
  width:75px; height:75px; background:rgba(255,255,255,.05); border-radius:50%;
}
.of-modal-head-icon {
  width:42px; height:42px; background:rgba(255,255,255,.15); border-radius:12px;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
  backdrop-filter:blur(4px); position:relative; z-index:1;
}
.of-modal-head-text { flex:1; position:relative; z-index:1; }
.of-modal-head h3 {
  font-size: 16px; font-weight: 700; color: #fff;
  display: flex; flex-direction:column; gap:2px;
}
.of-modal-head h3 small {
  font-size:11px; font-weight:400; color:rgba(255,255,255,.7); letter-spacing:.2px;
}
.of-modal-close {
  width: 30px; height: 30px; border-radius: 8px; border: none;
  background: rgba(255,255,255,.18); color: #fff; font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  backdrop-filter:blur(4px); position:relative; z-index:1; transition: background .15s;
}
.of-modal-close:hover { background: rgba(255,77,106,.5); }
/* Bande marge bénéficiaire */
.of-marge-bar {
  display:flex; align-items:center; justify-content:space-between;
  background: linear-gradient(135deg,rgba(0,196,140,.08),rgba(26,107,255,.06));
  border:1px solid rgba(0,196,140,.2); border-radius:10px; padding:9px 14px;
}
.of-marge-bar-label { font-size:10px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.5px; }
.of-marge-bar-val { font-size:14px; font-weight:700; font-family:'DM Mono',monospace; }
.of-marge-bar-val.pos  { color:var(--green); }
.of-marge-bar-val.neg  { color:var(--red); }
.of-marge-bar-val.zero { color:var(--text-muted); }



.of-modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.of-section-label {
  font-size: 10px; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: .8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--primary-light);
  margin-bottom: 4px;
}
.of-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.of-form-row.full { grid-template-columns: 1fr; }
.of-form-group { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.of-form-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.of-form-input, .of-form-select {
  height: 38px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: 'Sora', sans-serif; font-size: 13px; color: var(--text);
  background: var(--white); outline: none; transition: border .2s;
  width: 100%; box-sizing: border-box;
}
.of-form-input:focus, .of-form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,107,255,.08);
}
.of-form-textarea {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-family: 'Sora', sans-serif; font-size: 13px; color: var(--text);
  background: var(--white); outline: none; transition: border .2s;
  width: 100%; box-sizing: border-box; resize: none; min-height: 64px; line-height: 1.5;
}
.of-form-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,107,255,.08); }
/* Composants dynamiques */
.of-composants-list { display: flex; flex-direction: column; gap: 8px; }
.of-composant-row {
  display: grid; grid-template-columns: 1fr 110px 28px;
  gap: 6px; align-items: start;
}
.of-composant-row select, .of-composant-row input {
  height: 34px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: 'Sora', sans-serif; font-size: 12px; color: var(--text);
  background: var(--white); outline: none; width: 100%; box-sizing: border-box;
}
.of-composant-row select:focus, .of-composant-row input:focus { border-color: var(--primary); }
.of-composant-surf-info {
  font-size: 9.5px; font-weight: 600; color: var(--text-light);
  text-align: right; margin-top: 2px; min-height: 13px;
  font-family: 'DM Mono', monospace;
}
.of-btn-remove-composant {
  width: 28px; height: 28px; border-radius: 7px; border: none;
  background: rgba(255,77,106,.08); color: var(--red);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.of-btn-remove-composant:hover { background: rgba(255,77,106,.2); }
.of-btn-add-composant {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px;
  background: var(--primary-light); border: 1px solid var(--border);
  border-radius: 8px; font-family: 'Sora', sans-serif;
  font-size: 12px; font-weight: 600; color: var(--primary);
  cursor: pointer; transition: all .15s; width: fit-content;
}
.of-btn-add-composant:hover { background: var(--primary); color: white; border-color: var(--primary); }
.of-cout-total {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--primary-light); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px;
}
.of-cout-total-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.of-cout-total-val { font-size: 16px; font-weight: 700; font-family: 'DM Mono', monospace; color: var(--primary); }
.of-modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 20px; border-top: 1px solid var(--border);
  background: var(--bg); border-radius: 0 0 18px 18px;
  position: sticky; bottom: 0;
}
/* Detail panel */
.of-detail-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(13,27,62,.45); z-index: 500;
  backdrop-filter: blur(3px);
  align-items: flex-end; justify-content: center;
}
.of-detail-overlay.show { display: flex; }
.of-detail-panel {
  background: var(--white); border-radius: 20px 20px 0 0;
  width: 100%; max-width: 560px; max-height: 90vh;
  overflow-y: auto; padding: 0 0 32px;
  box-shadow: 0 -8px 40px rgba(13,27,62,.18);
  animation: slideUp .28s cubic-bezier(.4,0,.2,1);
}
.of-panel-handle { display:flex; justify-content:center; padding:12px 0 8px; }
.of-panel-handle::before { content:''; width:36px; height:4px; border-radius:99px; background:var(--border); }
.of-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 14px; border-bottom: 1px solid var(--border);
}
.of-panel-title { font-size: 16px; font-weight: 700; color: var(--text); }
.of-panel-close {
  width: 30px; height: 30px; border-radius: 8px; border: none;
  background: var(--surface2); color: var(--text-muted);
  font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.of-panel-body { padding: 18px 20px 0; }
.of-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.of-info-item { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.of-info-label { font-size: 10px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px; }
.of-info-value { font-size: 13px; font-weight: 700; color: var(--text); font-family: 'DM Mono', monospace; }
.of-info-value.muted { font-family: 'Sora', sans-serif; font-weight: 500; color: var(--text-muted); font-size: 12px; }
.of-composants-detail { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.of-composants-detail-head { padding: 8px 12px; font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; border-bottom: 1px solid var(--border); }
.of-composant-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 12px; }
.of-composant-item:last-child { border-bottom: none; }
.of-composant-nom { font-weight: 600; color: var(--text); }
.of-composant-qte { font-family: 'DM Mono', monospace; font-weight: 700; color: var(--primary); font-size: 11px; }
/* OF detail — section titre avec badge statut */
.of-panel-head-inner { display:flex; align-items:center; gap:10px; }
.of-panel-title-icon {
  width:36px; height:36px; border-radius:10px;
  background:linear-gradient(135deg,var(--primary),var(--purple));
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
/* OF detail — grille infos redesignée */
.of-kpi-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:12px; }
.of-kpi-card {
  background:var(--bg); border:1px solid var(--border); border-radius:12px;
  padding:11px 13px; display:flex; flex-direction:column; gap:3px;
}
.of-kpi-label {
  font-size:9.5px; font-weight:700; color:var(--text-light);
  text-transform:uppercase; letter-spacing:.7px;
  display:flex; align-items:center; gap:5px;
}
.of-kpi-label svg { opacity:.55; }
.of-kpi-value { font-size:clamp(11px,3.5vw,14px); font-weight:700; color:var(--text); font-family:'DM Mono',monospace; word-break:break-word; overflow-wrap:break-word; min-width:0; line-height:1.2; }
.of-kpi-value.green { color:var(--green); }
.of-kpi-value.blue  { color:var(--primary); }
/* OF detail — section composants */
.of-comps-wrap { border:1px solid var(--border); border-radius:12px; overflow:hidden; margin-bottom:12px; }
.of-comps-head {
  padding:9px 13px; font-size:9.5px; font-weight:700;
  color:var(--text-muted); text-transform:uppercase; letter-spacing:.7px;
  background:var(--bg); border-bottom:1px solid var(--border);
  display:flex; align-items:center; gap:6px;
}
.of-comp-row {
  display:flex; align-items:center; justify-content:space-between;
  padding:9px 13px; border-bottom:1px solid var(--border);
  background:var(--white);
}
.of-comp-row:last-child { border-bottom:none; }
.of-comp-name { font-size:12.5px; font-weight:600; color:var(--text); }
.of-comp-qty  { font-size:11px; font-weight:700; color:var(--primary); font-family:'DM Mono',monospace; }
.of-comp-total {
  padding:9px 13px; background:var(--primary-light);
  display:flex; justify-content:space-between; align-items:center;
}
.of-comp-total-label { font-size:10.5px; font-weight:700; color:var(--text-muted); }
.of-comp-total-val   { font-size:13px; font-weight:700; color:var(--primary); font-family:'DM Mono',monospace; }
/* OF detail — notes */
.of-notes-wrap {
  border:1px solid var(--border); border-radius:12px; padding:12px 13px;
  margin-bottom:12px; background:var(--bg);
}
.of-notes-label { font-size:9.5px; font-weight:700; color:var(--text-light); text-transform:uppercase; letter-spacing:.7px; margin-bottom:6px; }
.of-notes-text  { font-size:12.5px; color:var(--text); line-height:1.6; }
/* OF detail — pied de panel vide (boutons supprimés) */
.of-panel-footer { height:4px; }
/* Toast OF */
.of-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: white;
  padding: 10px 18px; border-radius: 10px;
  font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  z-index: 9999; display: none; animation: fadeUp .25s ease; white-space: nowrap;
}
.of-toast.show { display: block; }
.of-toast.success { background: var(--green); }
.of-toast.error   { background: var(--red); }
/* Mobile OF */
/* ── SKELETON LOADING Ordres de fabrication ── */
@keyframes of-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.of-sk {
  border-radius: 6px;
  background: linear-gradient(90deg, #eef3ff 25%, #dde6ff 50%, #eef3ff 75%);
  background-size: 800px 100%;
  animation: of-shimmer 1.4s infinite linear;
  flex-shrink: 0;
}
.of-sk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}
.of-sk-num     { width: 20px; height: 20px; border-radius: 5px; }
.of-sk-name    { height: 13px; border-radius: 5px; width: 55%; }
.of-sk-pill    { height: 18px; border-radius: 20px; width: 50px; }
.of-sk-meta    { height: 10px; border-radius: 4px; width: 80%; }
.of-sk-actions { width: 80px; height: 26px; border-radius: 7px; }
@media (max-width: 768px) {
.of-col-ref, .of-col-gain, .of-col-desktop { display: none; }
  .of-mobile-meta { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; font-size: 10px; font-weight: 600; font-family: 'DM Mono', monospace; color: var(--text-muted); }
  .of-table thead th:last-child, .of-table tbody td:last-child { text-align: right; }
  .of-table thead th { padding: 8px 8px; font-size: 8px; }
  .of-table tbody td { padding: 8px 8px; }
  .of-nom { font-size: 11px; }
  .of-form-row { grid-template-columns: 1fr; }
  .of-composant-row { grid-template-columns: 1fr 80px 28px; }
}
/* ══════════════════════════════
   GESTION PERSONNEL — ONGLETS
══════════════════════════════ */
/* ══ GP — HEADER ══ */
.gp-page-header {
  background: linear-gradient(135deg,#1A6BFF 0%,#7C5CFC 100%);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 4px 20px rgba(26,107,255,.18);
  position: relative; overflow: hidden;
}
.gp-page-header::before {
  content:''; position:absolute; top:-20px; right:-20px;
  width:90px; height:90px; background:rgba(255,255,255,.07); border-radius:50%;
}
.gp-ph-icon {
  width:40px; height:40px; min-width:40px;
  background:rgba(255,255,255,.15); border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  backdrop-filter:blur(4px);
}
.gp-ph-text { flex:1; min-width:0; }
.gp-ph-text h2 { font-size:16px; font-weight:700; color:#fff; letter-spacing:-.2px; }
.gp-ph-text p  { font-size:11px; color:rgba(255,255,255,.72); margin-top:1px; }

/* ══ KPI STRIP SCROLLABLE ══ */
.gp-kpi-strip {
  display: flex; gap: 10px; overflow-x: auto;
  padding-bottom: 4px; margin-bottom: 14px;
  scrollbar-width: none;
}
.gp-kpi-strip::-webkit-scrollbar { display: none; }
.gp-kpi-chip {
  min-width: 120px; flex-shrink: 0;
  background: var(--white); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 13px;
  box-shadow: 0 1px 6px rgba(26,107,255,.06);
}
.gp-kpi-chip-icon {
  width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 7px;
}
.gp-kpi-chip-val {
  font-size: 20px; font-weight: 800;
  font-family: 'DM Mono', monospace; line-height: 1;
}
.gp-kpi-chip-lbl {
  font-size: 9px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px; margin-top: 3px;
}
.gp-kpi-chip-bar {
  height: 2px; background: var(--border);
  border-radius: 2px; margin-top: 8px; overflow: hidden;
}
.gp-kpi-chip-bar-fill { height: 100%; border-radius: 2px; }







/* ══ ONGLETS ══ */
.gp-tabs {
  display: flex; gap: 5px; margin-bottom: 14px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px; box-shadow: var(--shadow);
}
.gp-tab {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 5px; height: 34px; border-radius: 9px; border: none;
  background: transparent; font-family: 'Sora', sans-serif;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: all .2s; white-space: nowrap;
}
.gp-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: white; box-shadow: 0 3px 10px rgba(26,107,255,.28);
}
.gp-tab:not(.active):hover { background: var(--primary-light); color: var(--primary); }
.gp-panel { display: none; }
.gp-panel.active { display: block; }

/* ══ BARRE DATE ══ */
.gp-datebar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.gp-date-input {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 0 12px; height: 38px;
  box-shadow: var(--shadow); flex: 1;
}
.gp-date-input input {
  border: none; outline: none; font-family: 'Sora', sans-serif;
  font-size: 13px; color: var(--text); background: transparent;
  cursor: pointer; width: 100%;
}
.gp-btn-save {
  display: flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: white; border: none; border-radius: 10px;
  padding: 0 16px; height: 38px;
  font-family: 'Sora', sans-serif; font-size: 12px; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 14px rgba(26,107,255,.3);
  transition: opacity .2s; white-space: nowrap; flex-shrink: 0;
}
.gp-btn-save:hover { opacity: .9; }
.gp-btn-save:active { transform: scale(.97); }

/* ══ BANDEAU STATUT JOURNÉE ══ */
.gp-status-bar {
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 10px; padding: 8px 12px; margin-bottom: 10px;
  font-family: 'Sora', sans-serif; font-size: 11px; font-weight: 600;
  border: 1px solid transparent;
}
.gp-status-bar.new {
  background: rgba(26,107,255,.06); border-color: rgba(26,107,255,.15);
  color: var(--primary);
}
.gp-status-bar.locked {
  background: rgba(255,184,0,.08); border-color: rgba(255,184,0,.3);
  color: #b07a00;
}
.gp-status-bar.editing {
  background: rgba(0,196,140,.08); border-color: rgba(0,196,140,.3);
  color: #007a5a;
}
.gp-status-bar-icon { font-size: 13px; margin-right: 5px; }
.gp-status-bar-right { font-size: 10px; opacity: .7; }

/* ══ LISTE EMPLOYÉS ══ */
.gp-appel-wrap {
  display: flex; flex-direction: column; gap: 7px;
  margin-bottom: 14px;
}

/* ── Carte employé (mode saisie) ── */
.gp-emp-card {
  background: var(--white); border-radius: 12px;
  border: 1.5px solid var(--border); box-shadow: var(--shadow);
  padding: 10px 12px; transition: all .2s;
}
.gp-emp-card.is-absent { opacity: .6; }
.gp-emp-top {
  display: flex; align-items: center; gap: 9px;
}
.gp-emp-avatar {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white;
}
.gp-emp-avatar.absent-av {
  background: linear-gradient(135deg, #ccd3e0, #b0b9c8);
}
.gp-emp-info { flex: 1; min-width: 0; }
.gp-emp-name  { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-emp-poste { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.gp-statut-btns { display: flex; gap: 4px; flex-shrink: 0; }
.gp-statut-btn {
  height: 28px; padding: 0 10px; border-radius: 7px;
  border: 1.5px solid var(--border); background: var(--white);
  font-size: 11px; font-weight: 700; cursor: pointer;
  font-family: 'Sora', sans-serif; transition: all .15s; color: var(--text-muted);
}
.gp-statut-btn.present-on { border-color: var(--green); background: rgba(0,196,140,.12); color: var(--green); }
.gp-statut-btn.absent-on  { border-color: var(--red);   background: rgba(255,77,106,.12); color: var(--red); }

/* ── Badge statut (mode lecture) ── */
.gp-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: 'Sora', sans-serif; font-size: 10px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px; flex-shrink: 0;
}
.gp-badge.present { background: rgba(0,196,140,.12); color: var(--green); }
.gp-badge.absent  { background: rgba(255,77,106,.12); color: var(--red); }

/* ── Zone articles (mode saisie) ── */
.gp-articles-zone {
  margin-top: 9px; padding-top: 8px;
  border-top: 1px dashed rgba(26,107,255,.15);
  display: flex; flex-direction: column; gap: 5px;
}
.gp-art-row { display: flex; align-items: center; gap: 5px; }
.gp-article-input {
  flex: 1; height: 30px; padding: 0 8px;
  border: 1.5px solid var(--border); border-radius: 7px;
  font-family: 'Sora', sans-serif; font-size: 11px; color: var(--text);
  background: var(--white); outline: none; transition: border .15s; min-width: 0;
}
.gp-article-input:focus { border-color: var(--primary); }
.gp-qty-input {
  width: 52px; height: 30px; padding: 0 4px; text-align: center;
  border: 1.5px solid var(--border); border-radius: 7px;
  font-family: 'DM Mono', monospace; font-size: 12px;
  font-weight: 700; color: var(--primary); outline: none;
  transition: border .15s; flex-shrink: 0;
}
.gp-qty-input:focus { border-color: var(--primary); }
.gp-art-del {
  width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
  border: none; background: rgba(255,77,106,.1); color: var(--red);
  font-size: 14px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: background .15s;
}
.gp-art-del:hover { background: rgba(255,77,106,.25); }
.gp-add-art {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 10px; margin-top: 2px;
  border: 1.5px dashed rgba(26,107,255,.35); border-radius: 7px;
  background: transparent; font-family: 'Sora', sans-serif;
  font-size: 11px; font-weight: 600; color: var(--primary); cursor: pointer; transition: all .15s;
}
.gp-add-art:hover { border-color: var(--primary); background: var(--primary-light); }

/* ── Ligne salaire ── */
.gp-sal-line {
  font-family: 'DM Mono', monospace; font-size: 11px;
  font-weight: 700; color: var(--text-muted);
  margin-top: 5px; text-align: right;
}

/* ── Articles mode lecture ── */
.gp-art-read {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0; border-bottom: 1px solid var(--border); gap: 8px;
}
.gp-art-read:last-child { border-bottom: none; }
.gp-art-read-name { font-size: 11px; color: var(--text-muted); flex: 1; }
.gp-art-read-qty  { font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 700; color: var(--primary); }
.gp-art-read-sal  { font-family: 'DM Mono', monospace; font-size: 10px; font-weight: 700; color: var(--green); min-width: 72px; text-align: right; }

/* ── Total journée carte ── */
.gp-emp-total {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 7px; padding-top: 6px; border-top: 1px solid var(--border);
}
.gp-emp-total-lbl { font-size: 10px; color: var(--text-muted); font-weight: 600; }
.gp-emp-total-val { font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 800; color: var(--primary); }




/* ══ KPI RÉSUMÉ JOURNÉE (grille 4) ══ */
.gp-resume-grid {
  display: grid; grid-template-columns: repeat(2,1fr);
  gap: 10px; margin-top: 14px;
}
.gp-kpi-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow);
}
.gp-kpi-label { font-size: 9px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px; }
.gp-kpi-val   { font-size: 22px; font-weight: 800; font-family: 'DM Mono', monospace; line-height: 1; }

/* ══ BILAN ══ */
.gp-bilan-filters {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}
.gp-bilan-filters select, .gp-bilan-filters input {
  height: 36px; padding: 0 10px; border: 1.5px solid var(--border);
  border-radius: 9px; font-family: 'Sora', sans-serif;
  font-size: 12px; color: var(--text); background: var(--white); outline: none;
}
.gp-bilan-filters select:focus, .gp-bilan-filters input:focus { border-color: var(--primary); }
.gp-bilan-kpis {
  display: grid; grid-template-columns: repeat(2,1fr);
  gap: 10px; margin-bottom: 12px;
}
.gp-bilan-kpi {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 13px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.gp-bilan-kpi::before {
  content:''; position:absolute; top:0; left:0; right:0; height:3px;
  background: var(--accent, var(--primary));
}
.gp-bilan-kpi-label { font-size: 9px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px; }
.gp-bilan-kpi-val   { font-size: 18px; font-weight: 800; font-family: 'DM Mono', monospace; line-height: 1; }
.gp-bilan-kpi-sub   { font-size: 10px; color: var(--text-muted); margin-top: 3px; }
.gp-bilan-table-wrap {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden;
}
.gp-bilan-table { width: 100%; border-collapse: collapse; }
.gp-bilan-table thead th {
  background: var(--bg); padding: 9px 10px; text-align: left;
  font-size: 9px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .8px;
  border-bottom: 1.5px solid var(--border); white-space: nowrap;
}
.gp-bilan-table tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
.gp-bilan-table tbody tr:last-child { border-bottom: none; }
.gp-bilan-table tbody tr:hover { background: var(--bg); }
.gp-bilan-table tbody td { padding: 9px 10px; font-size: 12px; color: var(--text); vertical-align: middle; }

/* ══ HISTORIQUE ══ */
.gp-histo-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.gp-histo-item:last-child { border-bottom: none; }
.gp-histo-item:hover { background: var(--bg); }
.gp-histo-date {
  font-size: 11px; font-weight: 700; color: var(--primary);
  font-family: 'DM Mono', monospace; flex-shrink: 0; min-width: 70px;
}
.gp-histo-info { flex: 1; min-width: 0; }
.gp-histo-titre { font-size: 12px; font-weight: 600; color: var(--text); }
.gp-histo-sub   { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.gp-histo-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; flex-shrink: 0; white-space: nowrap;
}
.gp-histo-badge.present { background: rgba(0,196,140,.12); color: var(--green); }
.gp-histo-badge.absent  { background: rgba(255,77,106,.12); color: var(--red); }

/* ══ MOBILE ══ */
@media (max-width: 768px) {
  .gp-tab { font-size: 10px; padding: 0 4px; gap: 3px; }
  .gp-emp-card { padding: 9px 10px; }
  .gp-emp-name { font-size: 12px; }
  .gp-article-input { font-size: 10px; }
  .gp-qty-input { width: 46px; font-size: 10px; }
  .gp-bilan-table thead th { padding: 7px 6px; font-size: 8px; }
  .gp-bilan-table tbody td { padding: 7px 6px; font-size: 11px; }
  .gp-col-bilan-poste { display: none; }
  .gp-resume-grid { grid-template-columns: repeat(2,1fr); }
}


/* ── AUTOCOMPLETE PRODUIT ── */
.mp-ac-wrap { position: relative; }
.mp-ac-icon {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  pointer-events: none; z-index: 1;
}
.mp-ac-input { padding-left: 32px !important; }
.mp-ac-box {
  position: absolute; top: calc(100% + 5px);
  left: 0; right: 0;
  background: var(--white);
  border: 1px solid rgba(26,107,255,0.2);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(26,107,255,0.13);
  z-index: 9999;
  max-height: 210px;
  overflow-y: auto;
  scrollbar-width: none;
}
.mp-ac-box::-webkit-scrollbar { display: none; }
.mp-ac-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.mp-ac-item:last-child { border-bottom: none; }
.mp-ac-item:hover { background: var(--primary-light); }
.mp-ac-item-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  display: block;
}
.mp-ac-item:hover .mp-ac-item-name { color: var(--primary); }
.mp-ac-item-sub {
  font-size: 10.5px; color: var(--text-muted);
  margin-top: 2px; display: block;
}
.mp-ac-empty {
  padding: 12px 14px;
  font-size: 12px; color: var(--text-muted);
  text-align: center;
}
/* ══ ENTRÉES DE STOCK ══ */
.es-toolbar { display:flex; align-items:center; gap:10px; background:var(--white); border:1px solid var(--border); border-radius:var(--radius); padding:10px 14px; margin-bottom:16px; flex-wrap:wrap; }
.es-search-bar { display:flex; align-items:center; gap:8px; flex:1; min-width:140px; }
.es-search-bar input { border:none; outline:none; font-family:'Sora',sans-serif; font-size:13px; color:var(--text); background:transparent; width:100%; }
.es-search-bar input::placeholder { color:var(--text-light); }
/* ── SKELETON LOADING Entrées de stock ── */
@keyframes es-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.es-sk {
  border-radius: 6px;
  background: linear-gradient(90deg, #eef3ff 25%, #dde6ff 50%, #eef3ff 75%);
  background-size: 800px 100%;
  animation: es-shimmer 1.4s infinite linear;
  flex-shrink: 0;
}
.es-sk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}
.es-sk-num     { width: 20px; height: 20px; border-radius: 5px; }
.es-sk-name    { height: 13px; border-radius: 5px; width: 50%; }
.es-sk-pill    { height: 18px; border-radius: 20px; width: 120px; }
.es-sk-actions { width: 80px; height: 26px; border-radius: 7px; }
.es-table-wrap { background:var(--white); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; margin-bottom:20px; }
.es-table { width:100%; border-collapse:collapse; font-size:12.5px; }
.es-table thead tr { background:var(--bg); border-bottom:2px solid var(--border); }
.es-table th { padding:10px 14px; text-align:left; font-size:10px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.6px; white-space:nowrap; }
.es-table td { padding:11px 14px; border-bottom:1px solid var(--border); vertical-align:middle; color:var(--text); }
.es-table tbody tr:last-child td { border-bottom:none; }
.es-table tbody tr:hover { background:var(--bg); }
.es-col-desktop { display:table-cell; }
@media(max-width:640px){ .es-col-desktop { display:none; } }
.es-badge-produit { display:inline-flex; align-items:center; gap:5px; background:var(--primary-light); color:var(--primary); font-size:10px; font-weight:700; padding:3px 9px; border-radius:20px; margin-top:3px; }
.es-val-green { color:var(--green); font-family:'DM Mono',monospace; font-weight:700; }
.es-val-red   { color:var(--red);   font-family:'DM Mono',monospace; font-weight:700; }
.es-val-blue  { color:var(--primary); font-family:'DM Mono',monospace; font-weight:700; }
.es-actions { display:flex; gap:6px; justify-content:flex-end; }
.es-btn { width:28px; height:28px; border-radius:7px; border:none; background:var(--bg); color:var(--text-muted); cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all .15s; }
.es-btn:hover { background:var(--primary-light); color:var(--primary); }
.es-btn.del:hover { background:rgba(255,77,106,.12); color:var(--red); }
/* Modal entrée stock */
.es-modal-overlay { display:none; position:fixed; inset:0; background:rgba(13,27,62,.45); z-index:600; backdrop-filter:blur(3px); align-items:center; justify-content:center; padding:16px; }
.es-modal-overlay.show { display:flex; }
.es-modal { background:var(--white); border-radius:18px; width:100%; max-width:480px; max-height:92vh; overflow-y:auto; box-shadow:var(--shadow-md); animation:fadeUp .25s ease; }
@keyframes fadeUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
.es-modal-head { display:flex; align-items:center; justify-content:space-between; padding:18px 20px 14px; border-bottom:1px solid var(--border); }
.es-modal-title { font-size:15px; font-weight:700; color:var(--text); }
.es-modal-close { width:30px; height:30px; border-radius:8px; border:none; background:var(--surface2); color:var(--text-muted); font-size:15px; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.es-modal-body { padding:18px 20px; display:flex; flex-direction:column; gap:14px; }
.es-form-group { display:flex; flex-direction:column; gap:5px; }
.es-form-label { font-size:10.5px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.6px; }
.es-form-input, .es-form-select, .es-form-textarea { width:100%; padding:9px 12px; border:1px solid var(--border); border-radius:9px; font-family:'Sora',sans-serif; font-size:13px; color:var(--text); background:var(--bg); outline:none; transition:border-color .2s; }
.es-form-input:focus, .es-form-select:focus, .es-form-textarea:focus { border-color:var(--primary); background:var(--white); }
.es-form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.es-form-textarea { min-height:64px; resize:vertical; }
.es-modal-footer { display:flex; gap:10px; padding:14px 20px 20px; border-top:1px solid var(--border); }
.es-btn-save { flex:1; height:42px; background:var(--primary); color:white; border:none; border-radius:10px; font-family:'Sora',sans-serif; font-size:13px; font-weight:700; cursor:pointer; transition:opacity .2s; }
.es-btn-save:hover { opacity:.88; }
.es-btn-cancel { height:42px; padding:0 18px; background:var(--bg); border:1px solid var(--border); border-radius:10px; font-family:'Sora',sans-serif; font-size:13px; color:var(--text-muted); cursor:pointer; }
/* Toast */
.es-toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); background:var(--text); color:white; padding:10px 20px; border-radius:10px; font-size:13px; font-weight:600; z-index:9999; opacity:0; pointer-events:none; transition:opacity .3s; white-space:nowrap; }
.es-toast.show { opacity:1; }
.es-toast.success { background:var(--green); }
.es-toast.error   { background:var(--red); }
/* ── NOUVEAU MODAL MULTI-ARTICLES ── */
.esm-date-block { background:var(--bg); border:1.5px solid var(--border); border-radius:12px; padding:14px 16px; display:flex; align-items:center; gap:12px; margin-bottom:4px; }
.esm-date-label { font-size:10px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.7px; margin-bottom:4px; }
.esm-date-input { border:none; outline:none; font-family:'Sora',sans-serif; font-size:15px; font-weight:700; color:var(--text); background:transparent; width:100%; }
.esm-date-icon { width:38px; height:38px; border-radius:10px; background:linear-gradient(135deg,var(--green),#00896a); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.esm-lignes-wrap { display:flex; flex-direction:column; gap:10px; }
.esm-ligne { background:var(--white); border:1.5px solid var(--border); border-radius:13px; padding:12px 14px; display:flex; flex-direction:column; gap:9px; position:relative; transition:border-color .2s; }
.esm-ligne:focus-within { border-color:var(--green); }
.esm-ligne-header { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.esm-ligne-num { width:22px; height:22px; border-radius:6px; background:linear-gradient(135deg,var(--green),#00896a); color:#fff; font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.esm-ligne-select { flex:1; border:none; outline:none; font-family:'Sora',sans-serif; font-size:13px; font-weight:600; color:var(--text); background:transparent; cursor:pointer; }
.esm-ligne-del { width:26px; height:26px; border-radius:7px; border:none; background:rgba(255,77,106,.1); color:var(--red); cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:background .15s; }
.esm-ligne-del:hover { background:rgba(255,77,106,.22); }
.esm-ligne-fields { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.esm-field { display:flex; flex-direction:column; gap:3px; }
.esm-field-label { font-size:9.5px; font-weight:700; color:var(--text-light); text-transform:uppercase; letter-spacing:.6px; }
.esm-field-input { border:1px solid var(--border); border-radius:8px; padding:7px 10px; font-family:'Sora',sans-serif; font-size:13px; font-weight:600; color:var(--text); background:var(--bg); outline:none; transition:border-color .2s; width:100%; }
.esm-field-input:focus { border-color:var(--green); background:var(--white); }
.esm-add-btn { display:flex; align-items:center; justify-content:center; gap:7px; width:100%; height:42px; border:1.5px dashed var(--border); border-radius:12px; background:transparent; color:var(--green); font-family:'Sora',sans-serif; font-size:13px; font-weight:700; cursor:pointer; transition:all .2s; margin-top:2px; }
.esm-add-btn:hover { border-color:var(--green); background:rgba(0,196,140,.06); }
.esm-notes-wrap { margin-top:2px; }
.esm-notes-label { font-size:10px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.7px; margin-bottom:5px; }
.esm-notes-input { width:100%; border:1.5px solid var(--border); border-radius:10px; padding:9px 12px; font-family:'Sora',sans-serif; font-size:13px; color:var(--text); background:var(--bg); outline:none; resize:vertical; min-height:58px; transition:border-color .2s; }
.esm-notes-input:focus { border-color:var(--green); background:var(--white); }
.esm-footer-info { font-size:11px; color:var(--text-light); text-align:center; padding:6px 0 2px; }
.esm-save-btn { flex:1; height:44px; background:linear-gradient(135deg,var(--green),#00896a); color:white; border:none; border-radius:11px; font-family:'Sora',sans-serif; font-size:13.5px; font-weight:700; cursor:pointer; transition:opacity .2s; letter-spacing:.2px; }
.esm-save-btn:hover { opacity:.88; }
.esm-save-btn:disabled { opacity:.55; cursor:not-allowed; }
.esm-cancel-btn { height:44px; padding:0 20px; background:var(--bg); border:1.5px solid var(--border); border-radius:11px; font-family:'Sora',sans-serif; font-size:13px; color:var(--text-muted); cursor:pointer; transition:all .15s; }
.esm-cancel-btn:hover { border-color:var(--text-muted); }
/* ES — panel détail */
.es-detail-overlay { display:none; position:fixed; inset:0; background:rgba(13,27,62,.45); z-index:600; backdrop-filter:blur(3px); align-items:flex-end; justify-content:center; }
.es-detail-overlay.show { display:flex; }
.es-detail-panel { background:var(--white); border-radius:20px 20px 0 0; width:100%; max-width:560px; max-height:88vh; overflow-y:auto; padding:0 0 28px; box-shadow:0 -8px 40px rgba(13,27,62,.18); animation:slideUp .28s cubic-bezier(.4,0,.2,1); }
.es-panel-handle { display:flex; justify-content:center; padding:12px 0 8px; }
.es-panel-handle::before { content:''; width:36px; height:4px; border-radius:99px; background:var(--border); }
.es-panel-head { display:flex; align-items:center; justify-content:space-between; padding:0 20px 14px; border-bottom:1px solid var(--border); }
.es-panel-head-inner { display:flex; align-items:center; gap:10px; }
.es-panel-icon { width:36px; height:36px; border-radius:10px; background:linear-gradient(135deg,var(--green),#00896a); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.es-panel-title { font-size:15px; font-weight:700; color:var(--text); }
.es-panel-close { width:30px; height:30px; border-radius:8px; border:none; background:var(--surface2); color:var(--text-muted); font-size:15px; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.es-panel-body { padding:18px 20px 0; display:flex; flex-direction:column; gap:12px; }
.es-panel-kpi-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.es-panel-kpi { background:var(--bg); border:1px solid var(--border); border-radius:12px; padding:11px 13px; display:flex; flex-direction:column; gap:3px; }
.es-panel-kpi-label { font-size:9.5px; font-weight:700; color:var(--text-light); text-transform:uppercase; letter-spacing:.7px; display:flex; align-items:center; gap:5px; }
.es-panel-kpi-val { font-size:15px; font-weight:700; font-family:'DM Mono',monospace; color:var(--text); }
.es-panel-kpi-val.green { color:var(--green); }
.es-panel-kpi-val.red   { color:var(--red); }
.es-panel-kpi-val.blue  { color:var(--primary); }
.es-panel-notes { background:var(--bg); border:1px solid var(--border); border-radius:12px; padding:12px 13px; }
.es-panel-notes-label { font-size:9.5px; font-weight:700; color:var(--text-light); text-transform:uppercase; letter-spacing:.7px; margin-bottom:6px; }
.es-panel-notes-text { font-size:13px; color:var(--text); line-height:1.6; }
/* ══ SUIVI PRODUCTION ══ */
.sp-tabs { display:flex; gap:6px; background:var(--bg); border:1px solid var(--border); border-radius:12px; padding:5px; margin-bottom:18px; }
.sp-tab { flex:1; padding:8px 10px; border:none; border-radius:9px; font-family:'Sora',sans-serif; font-size:11.5px; font-weight:600; color:var(--text-muted); background:transparent; cursor:pointer; transition:all .2s; text-align:center; }
.sp-tab.active { background:var(--white); color:var(--primary); box-shadow:0 1px 6px rgba(26,107,255,.1); }
.sp-toolbar { display:flex; align-items:center; gap:10px; background:var(--white); border:1px solid var(--border); border-radius:var(--radius); padding:10px 14px; margin-bottom:16px; }
.sp-search { display:flex; align-items:center; gap:8px; flex:1; }
.sp-search input { border:none; outline:none; font-family:'Sora',sans-serif; font-size:13px; color:var(--text); background:transparent; width:100%; }
.sp-search input::placeholder { color:var(--text-light); }
.sp-table-wrap { background:var(--white); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; margin-bottom:20px; }
.sp-table { width:100%; border-collapse:collapse; font-size:12.5px; }
.sp-table thead tr { background:var(--bg); border-bottom:2px solid var(--border); }
.sp-table th { padding:10px 14px; text-align:left; font-size:10px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.6px; white-space:nowrap; }
.sp-table td { padding:11px 14px; border-bottom:1px solid var(--border); vertical-align:middle; }
.sp-table tbody tr:last-child td { border-bottom:none; }
.sp-table tbody tr:hover { background:var(--bg); }
.sp-col-desktop { display:table-cell; }
@media(max-width:640px){ .sp-col-desktop { display:none !important; } }
.sp-nom { font-weight:700; font-size:13px; color:var(--text); }
.sp-ref { font-size:10px; color:var(--text-light); margin-top:2px; }
.sp-pill { display:inline-flex; align-items:center; gap:4px; font-size:9.5px; font-weight:700; padding:2px 8px; border-radius:20px; }
.sp-pill-actif { background:rgba(0,196,140,.1); color:var(--green); }
.sp-pill-perdu { background:rgba(255,77,106,.1); color:var(--red); }
.sp-mono-green { font-family:'DM Mono',monospace; font-weight:700; color:var(--green); font-size:clamp(10px,2.8vw,12.5px); white-space:nowrap; }
.sp-mono-red   { font-family:'DM Mono',monospace; font-weight:700; color:var(--red);   font-size:clamp(10px,2.8vw,12.5px); white-space:nowrap; }
.sp-mono-blue  { font-family:'DM Mono',monospace; font-weight:700; color:var(--primary); font-size:clamp(10px,2.8vw,12.5px); white-space:nowrap; }
.sp-mono-muted { font-family:'DM Mono',monospace; font-weight:600; color:var(--text-muted); font-size:clamp(10px,2.6vw,12px); white-space:nowrap; }
.sp-actions { display:flex; gap:5px; justify-content:flex-end; }
.sp-btn { width:28px; height:28px; border-radius:7px; border:none; background:var(--bg); color:var(--text-muted); cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all .15s; }
.sp-btn:hover { background:var(--primary-light); color:var(--primary); }
/* Panel détail SP */
.sp-detail-overlay { display:none; position:fixed; inset:0; background:rgba(13,27,62,.45); z-index:600; backdrop-filter:blur(3px); align-items:flex-end; justify-content:center; }
.sp-detail-overlay.show { display:flex; }
.sp-detail-panel { background:var(--white); border-radius:20px 20px 0 0; width:100%; max-width:560px; max-height:90vh; overflow-y:auto; padding:0 0 28px; box-shadow:0 -8px 40px rgba(13,27,62,.18); animation:slideUp .28s cubic-bezier(.4,0,.2,1); }
.sp-panel-handle { display:flex; justify-content:center; padding:12px 0 8px; }
.sp-panel-handle::before { content:''; width:36px; height:4px; border-radius:99px; background:var(--border); }
.sp-panel-head { display:flex; align-items:center; justify-content:space-between; padding:0 20px 14px; border-bottom:1px solid var(--border); }
.sp-panel-head-inner { display:flex; align-items:center; gap:10px; }
.sp-panel-icon { width:36px; height:36px; border-radius:10px; background:linear-gradient(135deg,var(--primary),var(--purple)); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.sp-panel-title { font-size:15px; font-weight:700; color:var(--text); }
.sp-panel-close { width:30px; height:30px; border-radius:8px; border:none; background:var(--surface2); color:var(--text-muted); font-size:15px; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.sp-panel-body { padding:18px 20px 0; display:flex; flex-direction:column; gap:12px; }
.sp-kpi-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.sp-kpi-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:7px; }
.sp-kpi-card { background:var(--bg); border:1px solid var(--border); border-radius:10px; padding:10px 12px; display:flex; flex-direction:column; gap:2px; min-width:0; }
.sp-kpi-card--wide { grid-column:span 1; }
.sp-kpi-label { font-size:9px; font-weight:700; color:var(--text-light); text-transform:uppercase; letter-spacing:.7px; display:flex; align-items:center; gap:4px; white-space:nowrap; }
.sp-kpi-val { font-size:clamp(12px,3.2vw,15px); font-weight:700; font-family:'DM Mono',monospace; color:var(--text); word-break:break-word; overflow-wrap:break-word; min-width:0; line-height:1.2; }
.sp-kpi-mono { font-family:'DM Mono',monospace; font-size:12px !important; }
.sp-kpi-val.green { color:var(--green); }
.sp-kpi-val.red   { color:var(--red); }
.sp-kpi-val.blue  { color:var(--primary); }
.sp-hist-item { background:var(--bg); border:1px solid var(--border); border-radius:12px; padding:12px 14px; display:flex; flex-direction:column; gap:6px; }
.sp-hist-header { display:flex; align-items:center; justify-content:space-between; }
.sp-hist-date { font-size:11px; font-weight:700; color:var(--text-muted); }
.sp-hist-badge { font-size:9px; font-weight:700; padding:2px 7px; border-radius:20px; white-space:nowrap; }
.sp-hist-badge.ajout { background:rgba(0,196,140,.12); color:var(--green); }
.sp-hist-badge.modif { background:var(--primary-light); color:var(--primary); }
.sp-hist-vals { display:flex; gap:12px; flex-wrap:wrap; }
.sp-hist-val { display:flex; flex-direction:column; gap:2px; }
.sp-hist-val-label { font-size:9px; font-weight:700; color:var(--text-light); text-transform:uppercase; letter-spacing:.5px; }
.sp-hist-val-num { font-size:13px; font-weight:700; font-family:'DM Mono',monospace; }
.sp-hist-title { font-size:10px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.7px; margin-top:4px; margin-bottom:8px; }
.sp-table-wrap { overflow-x:auto; border-radius:10px; border:1px solid var(--border); }
.sp-table { width:100%; border-collapse:collapse; font-family:'DM Mono',monospace; }
.sp-th { font-size:9px; font-weight:700; color:var(--text-light); text-transform:uppercase; letter-spacing:.6px; padding:8px 10px; background:var(--bg); border-bottom:1px solid var(--border); white-space:nowrap; }
.sp-th-num { width:28px; text-align:center; }
.sp-th-right { text-align:right; }
.sp-th-center { text-align:center; }
.sp-tr { border-bottom:1px solid var(--border); transition:background .15s; }
.sp-tr:last-child { border-bottom:none; }
.sp-tr:hover { background:var(--bg-hover,rgba(26,107,255,.04)); }
.sp-tr-modif { background:rgba(26,107,255,.03); }
.sp-td { font-size:12px; font-weight:600; color:var(--text); padding:8px 10px; vertical-align:top; }
.sp-td-num { text-align:center; font-size:10px; color:var(--text-muted); font-weight:700; }
.sp-td-right { text-align:right; }
.sp-td-center { text-align:center; }
.sp-td-green { color:var(--green); }
.sp-td-red { color:var(--red); }
.sp-td-blue { color:var(--primary); }
.sp-td-date { font-size:11px; font-weight:700; color:var(--text); white-space:nowrap; font-family:'Sora',sans-serif; }
.sp-td-modif { font-size:9px; color:var(--primary); margin-top:2px; }
.sp-td-note { font-size:9.5px; color:var(--text-muted); margin-top:2px; font-family:'Sora',sans-serif; max-width:140px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* ── Tableau compact historique personnel ── */
.gp-histo-table-wrap { overflow-x:auto; border-radius:var(--radius); border:1px solid var(--border); box-shadow:var(--shadow); background:var(--white); }
.gp-histo-table { width:100%; border-collapse:collapse; font-size:12px; }
.gp-histo-table thead tr { background:linear-gradient(135deg,var(--primary),var(--purple)); }
.gp-histo-table thead th { padding:10px 10px; color:#fff; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.6px; white-space:nowrap; text-align:left; }
.gp-histo-table tbody tr { border-bottom:1px solid var(--border); transition:background .15s; }
.gp-histo-table tbody tr:last-child { border-bottom:none; }
.gp-histo-table tbody tr:hover { background:var(--primary-light); }
.gp-histo-table tbody td { padding:9px 10px; vertical-align:middle; color:var(--text); font-size:11.5px; white-space:nowrap; }
.gp-histo-table .col-emp { font-weight:600; }
.gp-histo-table .col-poste { color:var(--text-muted); font-size:11px; }
.gp-histo-table .col-date { font-family:'DM Mono',monospace; font-size:11px; color:var(--text-muted); }
.gp-histo-table .col-pieces { font-family:'DM Mono',monospace; color:var(--purple); font-weight:700; text-align:center; }
.gp-histo-table .col-salaire { font-family:'DM Mono',monospace; color:var(--green); font-weight:700; text-align:right; }
.gp-histo-badge-present { display:inline-flex;align-items:center;gap:4px;background:rgba(0,196,140,.12);color:var(--green);font-size:9.5px;font-weight:700;padding:2px 8px;border-radius:20px; }
.gp-histo-badge-absent  { display:inline-flex;align-items:center;gap:4px;background:rgba(255,77,106,.10);color:var(--red);font-size:9.5px;font-weight:700;padding:2px 8px;border-radius:20px; }
.gp-histo-tag { display:inline-flex;align-items:center;font-size:9px;font-weight:700;padding:2px 7px;border-radius:12px;letter-spacing:.3px; }
.gp-histo-tag.ajout  { background:rgba(0,196,140,.12);color:var(--green); }
.gp-histo-tag.modif  { background:var(--primary-light);color:var(--primary); }
.gp-histo-tag.suppr  { background:rgba(255,77,106,.10);color:var(--red); }
.gp-histo-empty { text-align:center;padding:40px 16px;color:var(--text-muted);font-size:13px; }
/* Toast SP */
.sp-toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); background:var(--text); color:white; padding:10px 20px; border-radius:10px; font-size:13px; font-weight:600; z-index:9999; opacity:0; pointer-events:none; transition:opacity .3s; white-space:nowrap; }
.sp-toast.show { opacity:1; }
.sp-toast.success { background:var(--green); }
.sp-toast.error   { background:var(--red); }


/* ── STYLES INLINE SECTION 1 ── */
  
  /* ── Responsive commandes ── */
  @media (min-width: 768px) {
    #cvMobileHeader { display: none !important; }
    /* ── SKELETON LOADING Commandes & Ventes ── */
@keyframes cv-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.cv-sk {
  border-radius: 6px;
  background: linear-gradient(90deg, #eef3ff 25%, #dde6ff 50%, #eef3ff 75%);
  background-size: 800px 100%;
  animation: cv-shimmer 1.4s infinite linear;
  flex-shrink: 0;
}
/* Ligne skeleton MOBILE */
.cv-sk-row-mob {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  gap: 6px;
}
.cv-sk-num     { height: 13px; border-radius: 5px; width: 120px; }
.cv-sk-client  { height: 11px; border-radius: 4px; width: 80px; margin-top: 5px; }
.cv-sk-badge   { width: 68px; height: 24px; border-radius: 20px; }
.cv-sk-btn     { width: 30px; height: 30px; border-radius: 8px; }
/* Ligne skeleton DESKTOP */
.cv-sk-row-desk {
  border-bottom: 1px solid var(--border);
}
.cv-sk-row-desk td { padding: 13px 16px; }
.cv-sk-td-num  { height: 13px; border-radius: 5px; width: 110px; }
.cv-sk-td-name { height: 13px; border-radius: 5px; width: 90px; }
.cv-sk-td-sm   { height: 13px; border-radius: 5px; width: 60px; }
.cv-sk-td-badge{ height: 22px; border-radius: 20px; width: 70px; }
.cv-sk-td-acts { height: 30px; border-radius: 7px; width: 100px; float:right; }
    #cvTableBody    { display: none !important; }
    #cvDesktopWrapper { display: block !important; }
  }
  @media (max-width: 767px) {
    #cvDesktopWrapper { display: none !important; }
    #cvMobileHeader   { display: grid !important; }
    #cvTableBody      { display: block !important; }
  }

/* ── STYLES INLINE SECTION 2 ── */
    @media(max-width:768px){
      .det-table-wrap { display:none !important; }
      .det-mobile-list { display:flex !important; }
    }
    @media(min-width:769px){
      .det-table-wrap { display:block !important; }
      .det-mobile-list { display:none !important; }
    }

/* ── STYLES INLINE SECTION 3 ── */
    @media(max-width:768px){ .fac-table-wrap{display:none!important;} .fac-mobile-list{display:flex!important;} }
    @media(min-width:769px){ .fac-table-wrap{display:block!important;} .fac-mobile-list{display:none!important;} }
/* ═══════════════════════════════════════
   DASHBOARD V2 — LAYOUT FOODDASH
═══════════════════════════════════════ */
.db2-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:20px;flex-wrap:wrap;}
.db2-title{font-size:20px;font-weight:700;color:var(--text-main);margin:0 0 4px;}
.db2-sub{font-size:13px;color:var(--text-muted);margin:0;}
.db2-date{font-size:12px;color:var(--text-muted);background:var(--surface2);border:1px solid var(--border);border-radius:8px;padding:6px 12px;white-space:nowrap;align-self:flex-start;}

/* KPI GRID */
.db2-kpi-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-bottom:16px;}
.db2-kpi-card{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:14px 16px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;transition:border-color .2s,box-shadow .2s;}
.db2-kpi-card:hover{border-color:rgba(26,107,255,.35);box-shadow:0 4px 18px rgba(26,107,255,.08);}
.db2-kpi-left{display:flex;align-items:center;gap:12px;}
.db2-kpi-icon{width:38px;height:38px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.db2-kpi-label{font-size:11px;color:var(--text-muted);font-weight:500;margin-bottom:2px;}
.db2-kpi-val{font-size:20px;font-weight:700;color:var(--text-main);line-height:1.1;}
.db2-kpi-vs{font-size:10px;color:var(--text-light);margin-top:1px;}
.db2-kpi-delta{font-size:11px;font-weight:700;border-radius:6px;padding:3px 8px;white-space:nowrap;}
.db2-kpi-delta.up{background:rgba(0,196,140,.12);color:#00C48C;}
.db2-kpi-delta.down{background:rgba(255,77,106,.12);color:#FF4D6A;}
.db2-kpi-delta.neutral{background:rgba(124,92,252,.12);color:#7C5CFC;}

/* ROW 2 & 3 */
.db2-row2{display:grid;grid-template-columns:1fr;gap:12px;margin-bottom:16px;}
.db2-card{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:16px;}
.db2-card-head{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:14px;gap:8px;}
.db2-card-title{font-size:14px;font-weight:700;color:var(--text-main);}
.db2-card-sub{font-size:11px;color:var(--text-muted);margin-top:2px;}
.db2-legends{display:flex;align-items:center;flex-wrap:wrap;gap:4px;flex-shrink:0;}
.db2-leg-dot{display:inline-block;width:8px;height:8px;border-radius:50%;}
.db2-leg-txt{font-size:11px;color:var(--text-muted);margin-left:4px;}
.db2-view-all{font-size:11px;color:#1A6BFF;cursor:pointer;font-weight:600;white-space:nowrap;}

/* Revenus stats */
.db2-rev-stats{display:flex;gap:16px;margin-bottom:14px;}
.db2-rev-stat{flex:1;}
.db2-rev-val{font-size:16px;font-weight:700;}
.db2-rev-lbl{font-size:10px;color:var(--text-muted);margin-top:2px;}

/* Chart area */
.db2-chart-wrap{display:flex;gap:8px;align-items:stretch;}
.db2-y-labels{display:flex;flex-direction:column;justify-content:space-between;font-size:10px;color:var(--text-light);text-align:right;padding-bottom:20px;min-width:30px;}
.db2-svg{width:100%;height:140px;display:block;}
.db2-x-labels{display:flex;justify-content:space-between;font-size:10px;color:var(--text-light);margin-top:4px;padding:0 2px;}

/* Donut */
.db2-donut-wrap{display:flex;justify-content:center;margin:8px 0;}
.db2-donut-svg{width:130px;height:130px;}
.db2-donut-legend{display:flex;flex-direction:column;gap:10px;margin-top:8px;}
.db2-donut-row{display:flex;align-items:center;gap:8px;}
.db2-donut-lbl{font-size:12px;color:var(--text-muted);flex:1;}
.db2-donut-pct{font-size:12px;font-weight:700;color:var(--text-main);}

/* Production stats */
.db2-prod-stats{display:flex;gap:10px;margin-bottom:10px;}
.db2-prod-stat{flex:1;background:var(--surface2);border-radius:8px;padding:8px 10px;}
.db2-prod-val{font-size:16px;font-weight:700;}
.db2-prod-lbl{font-size:10px;color:var(--text-muted);margin-top:2px;}

/* Desktop : 2 colonnes sur les rangées 2 & 3 */
@media(min-width:768px){
  .db2-kpi-grid{grid-template-columns:repeat(4,1fr);}
  .db2-row2{grid-template-columns:1.6fr 1fr;}
}
/* ═══════════════════════════════════════════
   DASHBOARD FOODDASH
═══════════════════════════════════════════ */

/* Header */
.fd-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:24px;flex-wrap:wrap;}
@media(max-width:500px){.fd-header{flex-direction:column;gap:10px;}.fd-daterange-wrap{align-self:flex-start;}}
.fd-title{font-size:26px;font-weight:700;color:var(--text);margin:0 0 4px;letter-spacing:-.4px;}
.fd-sub{font-size:13.5px;color:var(--text-muted);margin:0;}
.fd-hero{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:22px;background:var(--surface);border:1.5px solid var(--border);border-radius:16px;padding:16px 20px;box-shadow:0 2px 12px rgba(26,107,255,.07);}
.fd-hero-left{display:flex;align-items:center;gap:14px;min-width:0;}
.fd-hero-avatar{width:46px;height:46px;min-width:46px;border-radius:13px;background:linear-gradient(135deg,var(--primary),var(--purple));display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:700;color:#fff;letter-spacing:-.5px;box-shadow:0 4px 12px rgba(26,107,255,.28);flex-shrink:0;}
.fd-hero-text{min-width:0;}
.fd-hero-greeting{font-size:11px;font-weight:600;color:var(--text-muted);letter-spacing:.6px;text-transform:uppercase;margin-bottom:2px;}
.fd-hero-name{font-size:18px;font-weight:700;color:var(--text);letter-spacing:-.3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.fd-hero-meta{font-size:11.5px;color:var(--text-muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
@media(max-width:500px){.fd-hero{flex-direction:column;align-items:flex-start;gap:12px;padding:14px 16px;}.fd-hero-left{width:100%;}.fd-daterange-wrap{align-self:flex-start;}}
.fd-daterange{display:flex;align-items:center;gap:7px;background:var(--surface);border:1.5px solid var(--border);border-radius:10px;padding:8px 14px;font-size:13px;color:var(--text-muted);cursor:pointer;white-space:nowrap;box-shadow:0 1px 4px rgba(26,107,255,.06);align-self:flex-start;user-select:none;}
/* KPI Grid */
.fd-kpi-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;margin-bottom:20px;}
@media(min-width:768px){.fd-kpi-grid{grid-template-columns:repeat(4,1fr);}}
.fd-kpi-card{background:var(--surface);border:1.5px solid var(--border);border-radius:16px;padding:18px 16px;display:flex;align-items:flex-start;gap:14px;cursor:pointer;transition:box-shadow .2s,border-color .2s;}
.fd-kpi-card:hover{box-shadow:0 6px 24px rgba(26,107,255,.10);border-color:rgba(26,107,255,.25);}
.fd-kpi-icon{width:44px;height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.fd-kpi-body{flex:1;min-width:0;}
.fd-kpi-label{font-size:12px;color:var(--text-muted);font-weight:500;margin-bottom:4px;}
.fd-kpi-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.fd-kpi-val{font-size:26px;font-weight:700;color:var(--text);line-height:1;letter-spacing:-.5px;}
.fd-kpi-badge{font-size:11px;font-weight:700;border-radius:6px;padding:3px 8px;white-space:nowrap;}
.fd-kpi-badge.up{background:rgba(0,196,140,.12);color:#00C48C;}
.fd-kpi-badge.down{background:rgba(255,77,106,.12);color:#FF4D6A;}
.fd-kpi-badge.neutral{background:rgba(124,92,252,.12);color:#7C5CFC;}
.fd-kpi-vs{font-size:11px;color:var(--text-light);margin-top:4px;}

/* Row layout */
.fd-row{display:grid;grid-template-columns:1fr;gap:14px;margin-bottom:20px;}
@media(min-width:768px){.fd-row{grid-template-columns:1.65fr 1fr;}}

/* Cards */
.fd-card{background:var(--surface);border:1.5px solid var(--border);border-radius:16px;padding:20px;}
.fd-card-lg{}
.fd-card-sm{}
.fd-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;margin-bottom:16px;}
.fd-card-title{font-size:15px;font-weight:700;color:var(--text);}
.fd-card-sub{font-size:11px;color:var(--text-muted);margin-top:3px;}

/* Legends */
.fd-legends{display:flex;align-items:center;flex-wrap:wrap;gap:4px;flex-shrink:0;}
.fd-leg-dot{display:inline-block;width:9px;height:9px;border-radius:50%;}
.fd-leg-lbl{font-size:11.5px;color:var(--text-muted);margin-left:5px;}
.fd-viewall{font-size:12px;color:var(--primary);cursor:pointer;font-weight:600;white-space:nowrap;}

/* Revenus stats strip */
.fd-rev-stats{display:flex;gap:0;margin-bottom:14px;border:1.5px solid var(--border);border-radius:12px;overflow:hidden;background:var(--surface2);}
.fd-rev-item{flex:1;padding:10px 12px;border-right:1px solid var(--border);display:flex;flex-direction:column;justify-content:center;min-width:0;}
.fd-rev-item:last-child{border-right:none;}
.fd-rev-lbl{font-size:9px;color:var(--text-light);font-weight:700;text-transform:uppercase;letter-spacing:.6px;margin-bottom:4px;display:flex;align-items:center;gap:4px;}
.fd-rev-val{font-size:15px;font-weight:700;line-height:1;letter-spacing:-.3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.fd-rev-delta{font-size:9px;font-weight:600;margin-top:3px;display:inline-flex;align-items:center;gap:2px;}
.fd-rev-delta.up{color:#00C48C;}
.fd-rev-delta.down{color:#FF4D6A;}
.fd-chartjs-wrap{position:relative;width:100%;height:150px;}
.fd-chartjs-wrap canvas{width:100%!important;height:150px!important;}

.fd-chart-area{display:flex;gap:8px;align-items:stretch;}
.fd-y-axis{display:flex;flex-direction:column;justify-content:space-between;font-size:10px;color:var(--text-light);text-align:right;padding-bottom:22px;min-width:32px;}
.fd-chart-inner{flex:1;position:relative;}
.fd-svg{width:100%;height:150px;display:block;}
.fd-x-axis{display:flex;justify-content:space-between;font-size:10px;color:var(--text-light);margin-top:5px;padding:0 2px;}
.fd-chartjs-wrap{position:relative;width:100%;height:150px;}
.fd-chartjs-wrap canvas{width:100%!important;height:150px!important;}

/* Donut */
.fd-donut-canvas-wrap{position:relative;width:180px;height:180px;margin:8px auto 16px;flex-shrink:0;}
.fd-donut-canvas-wrap canvas{width:180px!important;height:180px!important;}
.fd-donut-center{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;pointer-events:none;}
.fd-donut-center-val{font-size:26px;font-weight:700;color:var(--text);line-height:1;letter-spacing:-.5px;}
.fd-donut-center-lbl{font-size:10px;color:var(--text-muted);font-weight:500;margin-top:3px;text-transform:uppercase;letter-spacing:.4px;}
.fd-donut-legend{display:flex;flex-direction:column;gap:10px;margin-top:4px;}
.fd-donut-row{display:flex;align-items:center;gap:8px;}
.fd-donut-dot{width:9px;height:9px;border-radius:50%;flex-shrink:0;display:inline-block;}
.fd-donut-lbl{font-size:12.5px;color:var(--text-muted);flex:1;font-weight:500;}
.fd-donut-count{font-size:12.5px;font-weight:700;color:var(--text);min-width:20px;text-align:right;}
.fd-donut-pct{font-size:11px;font-weight:600;color:var(--text-light);min-width:36px;text-align:right;}

/* Production stats */
.fd-prod-stats{display:flex;gap:0;border:1px solid var(--border);border-radius:12px;overflow:hidden;margin-bottom:4px;}
.fd-prod-item{flex:1;padding:10px 12px;border-right:1px solid var(--border);}
.fd-prod-item:last-child{border-right:none;}
.fd-prod-val{font-size:15px;font-weight:700;line-height:1.1;}
.fd-prod-lbl{font-size:10px;color:var(--text-muted);margin-top:3px;}
/* ═══════════════════════════════════════
   KPI SCROLL + DATE PICKER
═══════════════════════════════════════ */

/* KPI — scroll horizontal sur mobile, grille sur desktop */
/* ══ KPI SCROLL — horizontal mobile, grille desktop ══ */
.fd-kpi-scroll{
  display:flex;
  flex-direction:row;
  gap:10px;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
  padding:2px 0 8px;
  margin-bottom:20px;
}
.fd-kpi-scroll::-webkit-scrollbar{display:none;}

.fd-kpi-scroll .fd-kpi-card{
  flex:0 0 140px;
  width:140px;
  scroll-snap-align:start;
  background:var(--surface);
  border:1.5px solid var(--border);
  border-radius:14px;
  padding:12px 12px 10px;
  cursor:pointer;
  transition:box-shadow .2s,border-color .2s;
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
  overflow:hidden;
}
.fd-kpi-scroll .fd-kpi-card:hover{
  box-shadow:0 6px 20px rgba(26,107,255,.10);
  border-color:rgba(26,107,255,.25);
}
.fd-kpi-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:4px;
  margin-bottom:4px;
}
.fd-kpi-icon{
  width:32px;height:32px;
  border-radius:9px;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
}
.fd-kpi-val{
  font-size:20px;
  font-weight:700;
  color:var(--text);
  line-height:1.1;
  letter-spacing:-.3px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:100%;
}
.fd-kpi-label{
  font-size:11px;
  color:var(--text-muted);
  font-weight:600;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.fd-kpi-vs{
  font-size:9.5px;
  color:var(--text-light);
  white-space:nowrap;
}
.fd-kpi-badge{
  font-size:9.5px;
  font-weight:700;
  border-radius:5px;
  padding:2px 6px;
  white-space:nowrap;
  flex-shrink:0;
}
.fd-kpi-badge.up{background:rgba(0,196,140,.12);color:#00C48C;}
.fd-kpi-badge.down{background:rgba(255,77,106,.12);color:#FF4D6A;}
.fd-kpi-badge.neutral{background:rgba(124,92,252,.12);color:#7C5CFC;}

@media(min-width:768px){
  .fd-kpi-scroll{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    overflow-x:visible;
    scroll-snap-type:none;
    padding-bottom:0;
  }
  .fd-kpi-scroll .fd-kpi-card{
    flex:unset;
    width:unset;
  }
  .fd-kpi-val{font-size:22px;}
}
@media(min-width:1024px){
  .fd-kpi-scroll{grid-template-columns:repeat(6,1fr);gap:12px;}
}

/* DATE PICKER */
.fd-daterange-wrap{position:relative;align-self:flex-start;}
.fd-daterange{
  display:flex;align-items:center;gap:7px;
  background:var(--surface);
  border:1.5px solid var(--border);
  border-radius:10px;
  padding:8px 14px;
  font-size:13px;color:var(--text-muted);
  cursor:pointer;white-space:nowrap;
  box-shadow:0 1px 4px rgba(26,107,255,.06);
  user-select:none;
  transition:border-color .2s;
}
.fd-daterange:hover{border-color:rgba(26,107,255,.3);}
.fd-picker-dropdown{
  display:none;
  position:fixed;
  background:var(--surface);
  border:1.5px solid var(--border);
  border-radius:12px;
  box-shadow:0 8px 28px rgba(26,107,255,.14);
  z-index:9999;
  min-width:180px;
  width:max-content;
  max-width:calc(100vw - 32px);
  overflow:hidden;
  animation:fdPickerIn .15s ease;
}
.fd-picker-dropdown.open{display:block;}
@keyframes fdPickerIn{
  from{opacity:0;transform:translateY(-4px);}
  to{opacity:1;transform:translateY(0);}
}
.fd-picker-option{
  padding:10px 15px;
  font-size:13px;
  color:var(--text-muted);
  cursor:pointer;
  transition:background .15s,color .15s;
  font-weight:500;
  white-space:nowrap;
}
.fd-picker-option:hover{background:var(--surface2);color:var(--text);}
.fd-picker-active{
  background:var(--primary-light);
  color:var(--primary);
  font-weight:700;
}
/* ══ Dashboard Alertes — liste numérotée ══ */
.dba-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Sora', sans-serif;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.dba-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.dba-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dba-liste {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 3px;
}
.dba-liste::-webkit-scrollbar { width: 4px; }
.dba-liste::-webkit-scrollbar-track { background: transparent; }
.dba-liste::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.dba-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: background .14s;
  min-width: 0;
}
.dba-item:hover { background: rgba(26,107,255,.04); }
.dba-item-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  text-align: center;
  flex-shrink: 0;
}
.dba-item-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dba-item-titre {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dba-item-detail {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dba-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}
.dba-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  font-family: 'Sora', sans-serif;
  letter-spacing: .2px;
  white-space: nowrap;
}
.dba-cat {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.dba-empty {
  text-align: center;
  padding: 28px 0;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Sora', sans-serif;
}
/* ══ Actions rapides dashboard ══ */
.fd-qa-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 10px;
  margin-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.fd-qa-track::-webkit-scrollbar { display: none; }
.fd-qa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  width: 72px;
  padding: 10px 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
  font-family: 'Sora', sans-serif;
  text-align: center;
}
.fd-qa-btn:hover {
  border-color: rgba(26,107,255,.3);
  box-shadow: 0 2px 10px rgba(26,107,255,.08);
  transform: translateY(-1px);
}
.fd-qa-btn:active { transform: scale(.97); }
.fd-qa-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fd-qa-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 64px;
  line-height: 1.2;
}
.fd-qa-sub {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 64px;
  line-height: 1.2;
}
/* ══ Production — filtres période ══ */
.prd-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Sora', sans-serif;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.prd-chip.active {
  background: #00C48C;
  color: #fff;
  border-color: #00C48C;
}
/* ══════════════════════════════════════════════════
   DESKTOP KPI LAYOUT — toutes sections
   Transforme les strips scroll en grilles aérées
══════════════════════════════════════════════════ */
@media (min-width: 768px) {

  /* ── Strip scroll → grille desktop ── */
  .kpi-scroll-strip {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    flex-direction: unset !important;
    padding: 4px 0 8px !important;
    margin-bottom: 20px !important;
    gap: 12px !important;
  }

  /* Chips fixes → flexibles en desktop */
  .kpi-scroll-strip .kpi-chip {
    width: auto !important;
    flex-shrink: unset !important;
    min-width: 0 !important;
  }

  /* ── KPI Ordres de fabrication (of) ── */
  #ofKpiStrip {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* ── KPI Entrées de stock (es) ── */
  #esKpiStrip {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  /* ── KPI Clients ── */
  #cliKpiStrip {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  /* ── KPI Commandes & Ventes ── */
  #cvKpiStrip {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    overflow-x: visible !important;
    gap: 12px !important;
  }

  /* ── KPI Fournisseurs ── */
  #frnKpiStrip {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* ── KPI Gestion du personnel (strip) ── */
  .gp-kpi-strip {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    overflow-x: visible !important;
    padding-bottom: 0 !important;
  }
  .gp-kpi-chip {
    flex-shrink: unset !important;
    width: auto !important;
    min-width: 0 !important;
  }

  /* ── KPI Salaires (inline style grid repeat(3)) ── */
  #section-salaires > div[style*="grid-template-columns:repeat(3"] {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
  }
  #salPanelAvance > div[style*="grid-template-columns:repeat(3"] {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
  }

/* ── KPI suivi production (sp-kpi-row / sp-kpi-grid) ── */
  .sp-kpi-row {
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 10px !important;
  }
  .sp-kpi-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
  .sp-kpi-card {
    padding: 9px 10px !important;
  }
  .sp-kpi-val {
    font-size: clamp(11px, 1.3vw, 14px) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sp-kpi-label {
    font-size: 8.5px !important;
    white-space: nowrap;
  }
  /* ── KPI Ordres de fab panel (of-kpi-row) ── */
  .of-kpi-row {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 12px !important;
  }
/* ── KPI Profil entreprise strip desktop ── */
  #section-profilEntreprise [style*="display:flex"][style*="overflow-x:auto"] {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    overflow-x: visible !important;
    gap: 12px !important;
    padding-bottom: 0 !important;
  }
  #section-profilEntreprise [style*="display:flex"][style*="overflow-x:auto"] > * {
    flex: unset !important;
    min-width: 0 !important;
    width: auto !important;
  }

  /* ── KPI Dettes (inline strip générique) ── */
/* ── KPI Dettes (inline strip générique) ── */
  #section-dettes .kpi-scroll-strip,
  #section-factures .kpi-scroll-strip,
  #section-alertes .kpi-scroll-strip {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* ── KPI Paiements strip desktop ── */
  #section-paiements [style*="display:flex"][style*="overflow-x:auto"] {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    overflow-x: visible !important;
    gap: 12px !important;
    padding-bottom: 0 !important;
  }
  #section-paiements [style*="display:flex"][style*="overflow-x:auto"] > * {
    min-width: 0 !important;
    flex: unset !important;
    flex-shrink: unset !important;
    width: auto !important;
  }

  /* ── KPI Dettes strip desktop ── */
  #section-dettes [style*="display:flex"][style*="overflow-x:auto"] {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    overflow-x: visible !important;
    gap: 12px !important;
    padding-bottom: 0 !important;
  }
  #section-dettes [style*="display:flex"][style*="overflow-x:auto"] > * {
    flex: unset !important;
    min-width: 0 !important;
    width: auto !important;
  }

  /* ── KPI Factures strip desktop ── */
  #section-factures [style*="display:flex"][style*="overflow-x:auto"] {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    overflow-x: visible !important;
    gap: 12px !important;
    padding-bottom: 0 !important;
  }
  #section-factures [style*="display:flex"][style*="overflow-x:auto"] > * {
    flex: unset !important;
    min-width: 0 !important;
    width: auto !important;
  }

  /* ── Strip #1985 (Suivi production header KPIs) ── */
  #section-suiviProduction .kpi-scroll-strip {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  /* ── KPI inline (style direct grid repeat) —
     cibler via parent section pour chaque cas ── */
  #section-salaires [style*="grid-template-columns:repeat(3,1fr)"] {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
  }

  /* ── es-panel-kpi-row → 4 colonnes ── */
  .es-panel-kpi-row {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 14px !important;
  }

/* ── KPI chips valeur plus grande sur desktop ── */
  .kpi-chip-val {
    font-size: clamp(18px, 2vw, 26px) !important;
  }

  .gp-kpi-chip-val {
    font-size: clamp(16px, 2vw, 24px) !important;
  }

 .sp-kpi-val { word-break:break-word; overflow-wrap:break-word; min-width:0;
    font-size: 14px !important;
  }
  .sp-kpi-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ── Grand écran : encore plus de colonnes ── */
@media (min-width: 1200px) {
  #ofKpiStrip  { grid-template-columns: repeat(3, 1fr) !important; }
  #esKpiStrip  { grid-template-columns: repeat(4, 1fr) !important; }
  #cliKpiStrip { grid-template-columns: repeat(4, 1fr) !important; }
  #cvKpiStrip  { grid-template-columns: repeat(5, 1fr) !important; }
  #frnKpiStrip { grid-template-columns: repeat(3, 1fr) !important; }

  .sp-kpi-row  { grid-template-columns: repeat(4, 1fr) !important; }
  .sp-kpi-grid { grid-template-columns: repeat(4, 1fr) !important; }
  .sp-kpi-card--wide { grid-column: span 2; }
  .of-kpi-row  { grid-template-columns: repeat(4, 1fr) !important; }
  .es-panel-kpi-row { grid-template-columns: repeat(4, 1fr) !important; }

  .kpi-chip-val     { font-size: 28px !important; }
  .gp-kpi-chip-val  { font-size: 26px !important; }
}
.cli-nom-meta { display:none; margin-top:4px; align-items:center; gap:6px; flex-wrap:wrap; }
.cli-nom-tel { font-size:11px; color:var(--text-muted); font-weight:500; display:inline-flex; align-items:center; gap:3px; font-family:'DM Mono',monospace; }
.cli-nom-cat { font-size:9px !important; padding:2px 7px !important; }
@media(min-width:768px){ .cli-nom-meta { display:flex; } }
/* ── KPI strip scrollbar masquée (Dettes) ── */
.det-kpi-strip::-webkit-scrollbar { display: none; }

/* ── Desktop Dettes : strip → grille 4 colonnes ── */
@media (min-width: 768px) {
  .det-kpi-strip {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    overflow-x: visible !important;
    padding-bottom: 0 !important;
  }
  .det-kpi-strip > div {
    width: auto !important;
    flex-shrink: unset !important;
  }
}
/* ── KPI strip Factures : scrollbar masquée ── */
.fac-kpi-strip::-webkit-scrollbar { display: none; }

/* ── Desktop Factures : strip → grille 4 colonnes ── */
@media (min-width: 768px) {
  .fac-kpi-strip {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    overflow-x: visible !important;
    padding-bottom: 0 !important;
  }
  .fac-kpi-strip > div {
    width: auto !important;
    flex-shrink: unset !important;
  }
}
/* ── MP colonnes desktop ── */
.mp-col-desktop { display: none; }

.mp-rh-cat, .mp-row-cat {
  width: 130px; flex-shrink: 0;
  font-size: 11px; font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mp-rh-seuil, .mp-row-seuil {
  width: 120px; flex-shrink: 0;
  font-size: 11px; font-weight: 500;
  font-family: 'DM Mono', monospace;
  color: var(--text-muted);
  text-align: right;
}
.mp-rh-prix, .mp-row-prix {
  width: 120px; flex-shrink: 0;
  font-size: 11px; font-weight: 500;
  font-family: 'DM Mono', monospace;
  color: var(--text-muted);
  text-align: right;
}

@media (min-width: 768px) {
  .mp-col-desktop { display: flex; align-items: center; }
  .mp-row-header, .mp-row { gap: 0; padding: 11px 16px; }
  .mp-row-name { flex: 1; min-width: 0; max-width: none; padding-left: 12px; }
  .mp-rh-name  { flex: 1; min-width: 0; padding-left: 12px; }
  .mp-rh-cat, .mp-row-cat   { display: flex; }
  .mp-rh-seuil, .mp-row-seuil { display: flex; justify-content: flex-end; }
  .mp-rh-prix, .mp-row-prix   { display: flex; justify-content: flex-end; }
  .mp-rh-stock, .mp-row-stock { width: 130px; text-align: right; justify-content: flex-end; }
  .mp-rh-actions, .mp-row-actions { width: 96px; justify-content: center; }
}
/* ── Bouton Annuler achat récent ── */
.mp-btn-cancel-recent {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  background: rgba(255, 140, 0, 0.13) !important;
  color: #FF8C00 !important;
  border: 1.5px solid rgba(255, 140, 0, 0.35) !important;
  border-radius: 9px;
  cursor: pointer;
  transition: background .18s, transform .12s, box-shadow .18s;
  box-shadow: 0 2px 8px rgba(255, 140, 0, 0.13);
  flex-shrink: 0;
}
.mp-btn-cancel-recent:hover {
  background: rgba(255, 140, 0, 0.24) !important;
  box-shadow: 0 4px 14px rgba(255, 140, 0, 0.22);
}
.mp-btn-cancel-recent:active {
  transform: scale(.93);
}
/* ═══════════════════════════════════════════
   @MEDIA PRINT — Impression propre rapport
═══════════════════════════════════════════ */
@media print {
  /* Masquer tout sauf le contenu du rapport */
  body > *:not(#rptPdfModal) { display:none !important; }
  #rptPdfModal {
    position:static !important;
    background:none !important;
    backdrop-filter:none !important;
    padding:0 !important;
    display:block !important;
  }
  #rptPdfInner {
    box-shadow:none !important;
    border-radius:0 !important;
    max-width:100% !important;
    width:100% !important;
    margin:0 !important;
  }
  /* Masquer la barre sticky avec boutons Imprimer / Fermer */
  #rptPdfInner > div:first-child { display:none !important; }
  /* Contenu pleine page */
  #rptPdfContent {
    padding:10mm 12mm !important;
    font-size:11px !important;
  }
  /* Éviter les coupures de page dans les tableaux */
  table { page-break-inside:auto; }
  tr    { page-break-inside:avoid; page-break-after:auto; }
  thead { display:table-header-group; }
  /* Forcer fond blanc, texte noir pour impression */
  * {
    -webkit-print-color-adjust:exact;
    print-color-adjust:exact;
  }
}