/* Vallon Partenaires — mobile : menus déroulants, tableaux compacts, admin terrain */

.vp-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 90;
}
.vp-sidebar-backdrop:not(.hidden) { display: block; }

@media (max-width: 900px) {
  .vp-content { padding: 1rem; overflow-x: hidden; }
  .vp-kpi-row { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .vp-kpi { padding: 0.75rem; }
  .vp-kpi strong { font-size: 1.1rem; }

  .vp-sidebar { z-index: 100; box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25); }

  .vp-topbar {
    flex-wrap: nowrap;
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 80;
    background: var(--vp-surface);
    border-bottom: 1px solid var(--vp-border);
  }
  .vp-crumb {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  .vp-topbar-actions {
    flex-shrink: 0;
    gap: 0.25rem;
  }
  .vp-topbar-actions #eco-dots-slot { display: none; }
  .vp-topbar-actions .vp-hub-status {
    display: none;
    max-width: 0;
    overflow: hidden;
  }
  .vp-topbar-actions .vp-user { display: none; }

  .vp-notif-panel {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    top: 56px;
    max-width: none;
    width: auto;
    z-index: 95;
  }

  .vp-filter-drawer {
    margin-bottom: 1rem;
    border: 1px solid var(--vp-border);
    border-radius: var(--vp-radius);
    background: var(--vp-surface);
    overflow: hidden;
  }
  .vp-filter-drawer summary {
    padding: 0.75rem 1rem;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .vp-filter-drawer summary::-webkit-details-marker { display: none; }
  .vp-filter-drawer summary::after { content: '▾'; color: var(--vp-muted); }
  .vp-filter-drawer[open] summary::after { transform: rotate(180deg); }
  .vp-filter-drawer-body { padding: 0 1rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }

  .vp-table-wrap { overflow-x: visible; }
  .vp-table-wrap .vp-table thead { display: none; }
  .vp-table-wrap .vp-table tbody tr {
    display: block;
    margin-bottom: 0.65rem;
    border: 1px solid var(--vp-border);
    border-radius: var(--vp-radius);
    padding: 0.65rem 0.85rem;
    background: var(--vp-surface);
  }
  .vp-table-wrap .vp-table td {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border: none;
    font-size: 0.82rem;
    text-align: right;
  }
  .vp-table-wrap .vp-table td::before {
    content: attr(data-label);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--vp-muted);
    flex-shrink: 0;
    text-align: left;
  }
  .vp-table-wrap .vp-table td.vp-actions-inline {
    justify-content: flex-start;
    flex-wrap: wrap;
    padding-top: 0.5rem;
    border-top: 1px solid var(--vp-border);
    margin-top: 0.25rem;
  }
  .vp-table-wrap .vp-table td.vp-actions-inline::before { display: none; }

  .chantier-tab-bar, .st-chantier-tab-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.25rem;
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
  }
  .chantier-tab-btn, .st-tab {
    flex-shrink: 0;
    font-size: 0.72rem;
    padding: 0.4rem 0.6rem;
  }

  .chantier-dash-header {
    flex-direction: column;
    align-items: stretch;
  }
  .chantier-dash-header .donut-wrap,
  .chantier-dash-header svg {
    max-width: 100%;
    align-self: center;
  }

  .chantier-alerts-rail h4 { font-size: 0.82rem; }
  .chantier-todo-chips { flex-wrap: wrap; gap: 0.35rem; }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  .poste-row, .bc-poste-grid, .tranche-header-row {
    grid-template-columns: 1fr !important;
    gap: 0.5rem;
  }

  .glass, .vp-panel {
    max-width: 100%;
    overflow-x: auto;
  }

  .bc-preview-block, .candidature-thread { max-width: 100%; }

  .vp-mobile-section {
    border: 1px solid var(--vp-border);
    border-radius: var(--vp-radius);
    margin-bottom: 0.65rem;
    background: var(--vp-surface);
  }
  .vp-mobile-section summary {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.86rem;
    cursor: pointer;
    list-style: none;
  }
  .vp-mobile-section summary::-webkit-details-marker { display: none; }
  .vp-mobile-section-body { padding: 0 1rem 1rem; }

  .st-chantier-picker {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .st-chantier-pill { flex-shrink: 0; }

  .fact-postes-list { max-height: 50vh; overflow-y: auto; }
  .vp-detail-head { flex-direction: column; }
  .vp-page-head h1, .page-title { font-size: 1.2rem; }

  .auth-split { grid-template-columns: 1fr !important; }
  .auth-form-panel { padding: 1.25rem; }

  .vp-admin-panel-collapse > summary {
    padding: 0.7rem 0.9rem;
    font-weight: 600;
    font-size: 0.84rem;
    cursor: pointer;
    list-style: none;
    border: 1px solid var(--vp-border);
    border-radius: var(--vp-radius);
    margin-bottom: 0.5rem;
    background: var(--vp-surface);
  }
  .vp-admin-panel-collapse > summary::-webkit-details-marker { display: none; }
}

@media (max-width: 480px) {
  .vp-kpi-row { grid-template-columns: 1fr 1fr; }
}