/* ==========================================================================
   style-outils.css
   Feuille de styles partagee pour tous les outils de gestion Office-Box
   ========================================================================== */

/* ==================== VARIABLES CSS ==================== */
:root {
    --bg-page: #f6f8fc;
    --success-light: rgba(22, 163, 74, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger: #dc2626;
    --danger-light: rgba(220, 38, 38, 0.1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
}

/* ==================== ANIMATIONS ==================== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slideIn {
    from { transform: translateY(-18px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

@keyframes obConfirmIn {
    from { opacity: 0; transform: scale(.94) translateY(-8px); }
    to   { opacity: 1; transform: scale(1)   translateY(0); }
}

/* ==================== LAYOUT GENERAL ==================== */

/* Pages AVEC sous-menu : le secondary-menu occupe deja l'espace sous le menu fixe */
main.main { margin-top: 4px; }
/* Pages SANS sous-menu : compensate le menu fixe (60px) */
main.main.no-submenu { margin-top: 60px; }

/* ==================== SECONDARY MENU ==================== */
.secondary-menu {
    background: linear-gradient(180deg, #eef3fb 0%, #e4ecf7 100%);
    border-bottom: 1px solid #d4e0f0;
    padding: 12px 24px;
    overflow-x: auto;
    margin-top: 60px;
}

.secondary-menu--sub {
    margin-top: 0;
    background: linear-gradient(180deg, #f5f8fd 0%, #edf2fb 100%);
    border-top: 1px solid #c8d8ee;
}

.secondary-menu-container {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
    justify-content: center;
}

.menu-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 10px;
    min-width: 72px;
    text-decoration: none;
    color: var(--text-dark);
    border-radius: 8px;
    transition: all 0.15s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.menu-icon-item:hover {
    background: rgba(255, 255, 255, 0.7);
}

.menu-icon-item.active {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
}

.menu-icon-item i {
    font-size: 1.25rem;
    margin-bottom: 4px;
    color: var(--primary);
}

.menu-icon-item span {
    font-size: 0.65rem;
    text-align: center;
    color: var(--text-gray);
    line-height: 1.2;
}

/* ==================== MAIN ==================== */
.main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 6px 20px 20px; /* top reduit pour coller au menu */
}

/* ==================== FILTERS ==================== */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label,
.chart-header p,
.legend-item,
.activity-content p {
    font-size: 0.8rem;
    color: var(--text-gray);
}

.filter-label {
    font-weight: 500;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--bg-white);
    cursor: pointer;
    min-width: 120px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ==================== BLOCS BLANCS ==================== */
.kpi-card,
.actions-section,
.chart-card,
.table-card,
.activity-card,
.shortcuts-section {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.kpi-card,
.actions-section,
.chart-card,
.activity-card,
.shortcuts-section {
    padding: 20px;
}

.actions-section,
.chart-card,
.shortcuts-section {
    padding: 24px;
}

.table-card {
    overflow: hidden;
}

/* ==================== KPI CARDS ==================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    transition: all 0.2s ease;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
}

.kpi-card.highlight {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
    border-color: var(--warning);
}

.kpi-card.highlight .kpi-value {
    color: var(--warning);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.kpi-icon.blue {
    background: var(--primary-light);
    color: var(--primary);
}

.kpi-icon.green {
    background: var(--success-light);
    color: var(--success);
}

.kpi-icon.yellow {
    background: var(--warning-light);
    color: var(--warning);
}

.kpi-icon.red {
    background: var(--danger-light);
    color: var(--danger);
}

.kpi-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 20px;
}

.kpi-trend.up {
    background: var(--success-light);
    color: var(--success);
}

.kpi-trend.down {
    background: var(--danger-light);
    color: var(--danger);
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin-bottom: 4px;
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-gray);
}

.kpi-sub {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* ==================== ACTIONS PRIORITAIRES ==================== */
.actions-section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--primary);
}

.badge-count {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.action-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s ease;
}

.action-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.action-card.urgent {
    border-left: 4px solid var(--danger);
}

.action-card.warning {
    border-left: 4px solid var(--warning);
}

.action-card.info {
    border-left: 4px solid var(--primary);
}

.action-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.action-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.action-priority {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
}

.action-priority.high {
    background: var(--danger-light);
    color: var(--danger);
}

.action-priority.medium {
    background: var(--warning-light);
    color: var(--warning);
}

.action-priority.low {
    background: var(--primary-light);
    color: var(--primary);
}

.action-content h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.action-content p {
    font-size: 0.75rem;
    color: var(--text-gray);
    line-height: 1.4;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-light);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.action-btn:hover {
    background: var(--primary);
    color: white;
}

/* ==================== GRID LAYOUT ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.dashboard-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

/* ==================== CHARTS ==================== */
.chart-header {
    margin-bottom: 20px;
}

.chart-header h3,
.table-card-header h3,
.tips-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.chart-header h3 {
    margin-bottom: 4px;
}

.chart-container {
    position: relative;
    height: 250px;
}

.chart-legend-custom {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* ==================== TABLES ==================== */
.table-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-all-link {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-all-link:hover,
.table-action:hover {
    text-decoration: underline;
}

/* ---- Base table partagée ---- */
.data-table,
.users-table,
.config-table,
.jc-table,
.jc-recap-table,
.imp-table,
.rappel-table,
.vers-table,
.ver-table,
.calc-steps,
.adr-table,
.dv-lig-table,
.sv-table,
.vs-table,
.stock-table,
.comp-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table {
    /* propriétés spécifiques data-table */
}

.data-table th {
    text-align: left;
    padding: 12px 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 14px 20px;
    font-size: 0.85rem;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--bg-page);
}

.table-amount {
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.table-amount.danger {
    color: var(--danger);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 20px;
}

.status-badge.pending {
    background: var(--warning-light);
    color: var(--warning);
}

.status-badge.open {
    background: var(--primary-light);
    color: var(--primary);
}

.status-badge.overdue {
    background: var(--danger-light);
    color: var(--danger);
}

.table-action {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
}

/* ==================== ACTIVITY CARDS ==================== */
.activity-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.activity-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.activity-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.activity-content h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ==================== TIPS ==================== */
.tips-card {
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(0, 51, 153, 0.04) 100%);
    border: 1px solid rgba(0, 51, 153, 0.15);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.tips-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.tips-header i {
    font-size: 1.25rem;
    color: var(--primary);
}

.tips-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-gray);
    line-height: 1.5;
}

.tip-item i {
    color: var(--success);
    margin-top: 4px;
    flex-shrink: 0;
}

/* ==================== SHORTCUTS ==================== */
.shortcuts-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.shortcut-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text-dark);
}

.shortcut-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.shortcut-btn.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.shortcut-btn.primary:hover {
    background: var(--primary-dark);
}

/* ==================== PAGE CARD (rappels, parametres, outils) ==================== */
.page-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 10px;
    margin-bottom: 24px;
    overflow: visible;
}

.page-title {
    font-size: 1.35rem;
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-gray);
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.toolbar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.toolbar-label {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-weight: 500;
}

.toolbar-form {
    margin: 0;
}

/* ==================== CONFIG TABLE ==================== */
.config-table {
    width: 100%;
    border-collapse: collapse;
}

.config-table th {
    text-align: left;
    padding: 12px 10px;
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--text-gray);
    background: var(--bg-page);
    border-bottom: 1px solid var(--border);
}

.config-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.config-table input[type="text"],
.config-table select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    background: #fff;
}

.config-table input[type="text"]:focus,
.config-table select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

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

.delay-table td {
    padding: 10px 6px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

/* ==================== HELPER / INFO BOX ==================== */
.helper-box,
.info-box {
    margin-top: 18px;
    padding: 16px;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-gray);
    font-size: 0.9rem;
    line-height: 1.6;
}

.helper-box {
    border-radius: 10px;
    margin-top: 20px;
}

.info-box {
    border-radius: var(--radius-sm);
}

/* ==================== SECTION TITLE CUSTOM ==================== */
.section-title-custom {
    font-size: 1.1rem;
    margin: 8px 0 18px;
}

/* ==================== SAVING OVERLAY ==================== */
.saving-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: none;
    z-index: 9998;
}

.saving-box {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 320px;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 24px;
    text-align: center;
    display: none;
    z-index: 9999;
}

.saving-box h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.saving-box p {
    margin: 0;
    color: var(--text-gray);
    font-size: 0.9rem;
}

.saving-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #dbe4f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 14px;
    animation: spin 0.8s linear infinite;
}

/* ==================== FIELD GROUP ==================== */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 200px;
}

.field-group label {
    font-size: 0.82rem;
    color: var(--text-gray);
    font-weight: 600;
}

.field-group input,
.field-group select,
.field-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    background: #fff;
}

.field-group textarea {
    min-height: 120px;
    resize: vertical;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Extensions field-group pour modales (adresses, articles) */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.field-group.full { grid-column: 1 / -1; }
.field-group.checkbox-group { flex-direction: row; align-items: center; gap: 10px; }
.field-group.checkbox-group label { text-transform: none; font-size: .88rem; }
.field-group.checkbox-group input[type=checkbox] { width: 18px; height: 18px; padding: 0; accent-color: var(--primary); }
.field-group.radio-group { display: flex; flex-direction: row; align-items: center; gap: 16px; flex-wrap: wrap; }
.field-group.radio-group label { text-transform: none; font-size: .88rem; font-weight: 500; }
.field-group.radio-group .radio-lbl { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; width: 100%; }
.field-group input[readonly], .field-group select[disabled] {
    background: var(--bg-light); color: #374151; cursor: default;
}

/* ==================== ALERTS ==================== */
.alert-success,
.alert-error,
.alert-saving {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 0.92rem;
    display: none;
}

.alert-success {
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-saving {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* ==================== BUTTONS ==================== */
.btn-row {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
}

/* ---- Base bouton partagée ---- */
.btn-primary-custom,
.btn-secondary-custom,
.btn-insert,
.btn-ventiler,
.btn-calculer,
.btn-del-ver {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary-custom {
    background: var(--primary);
    color: #fff;
    padding: 10px 16px;
}
.btn-primary-custom:hover { background: var(--primary-dark); }

.btn-secondary-custom {
    border: 1px solid var(--border);
    color: var(--text-dark);
    padding: 10px 16px;
    background: #fff;
}
.btn-secondary-custom:hover { border-color: var(--primary); color: var(--primary); }

/* ==================== TYPE SWITCH ==================== */
.type-switch {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.type-switch a {
    text-decoration: none;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text-dark);
    background: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.type-switch a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.type-switch a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ==================== LAYOUT 2 COLONNES (adresses, articles) ==================== */
.adr-layout      { display: flex; gap: 20px; align-items: flex-start; }
.adr-col-results { flex: 1; min-width: 0; }
.adr-col-side    { width: 240px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; }

/* ==================== CARTES SECTIONS (adresses, articles) ==================== */
.sec-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.sec-head {
    background: var(--bg-white); color: var(--text-dark);
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 8px;
    font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.sec-head i { color: var(--primary); }
.sec-head .sec-count {
    margin-left: auto; background: var(--primary); color: #fff;
    padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700;
}
.sec-body { padding: 14px; }
.sec-sep  { height: 1px; background: var(--border); margin: 10px 0; }

/* ==================== RECHERCHE (adresses, articles) ==================== */
.adr-search-wrap { position: relative; margin-bottom: 10px; }
.adr-search-icon {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--text-light); font-size: .83rem; pointer-events: none;
}
.adr-search-input {
    width: 100%; padding: 8px 10px 8px 30px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.85rem; color: var(--text-dark); background: var(--bg-light);
    transition: border-color .15s; box-sizing: border-box; font-family: inherit;
}
.adr-search-input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light); background: var(--bg-white);
}
.adr-cat-filter {
    width: 100%; padding: 8px 10px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.83rem; color: var(--text-dark); background: var(--bg-light);
    box-sizing: border-box; margin-bottom: 10px;
    transition: border-color .15s; font-family: inherit;
}
.adr-cat-filter:focus { outline: none; border-color: var(--primary); }

/* ==================== TABLEAU RESULTATS (adresses, articles) ==================== */
.adr-table { font-size: 0.875rem; }
.adr-table th {
    background: #e8f0fb; color: var(--primary); padding: 9px 12px; text-align: left;
    font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 2px solid var(--primary);
}
.adr-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.adr-table tbody tr { cursor: pointer; transition: background .1s; }
.adr-table tbody tr:hover td { background: var(--primary-light); }
.adr-table tbody tr.selected td { background: var(--primary-light); }
.adr-ref   { font-weight: 700; color: var(--primary); font-size: .8rem; }
.adr-name  { font-weight: 600; color: var(--text-dark); }
.adr-sub   { font-size: .78rem; color: var(--text-gray); }
.adr-badge {
    display: inline-block; padding: 2px 7px; border-radius: 999px;
    font-size: .7rem; font-weight: 600;
    background: var(--primary-light); color: var(--primary);
}
#adr-empty, #art-empty       { text-align: center; padding: 40px 20px; color: var(--text-light); font-size: .9rem; display: none; }
#adr-empty-hint, #art-empty-hint { text-align: center; padding: 40px 20px; color: var(--text-light); font-size: .88rem; }
#adr-info, #art-found {
    margin-top: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
    background: var(--bg-light); border: 1px solid var(--border);
    font-size: .78rem; color: var(--text-gray); text-align: center; display: none;
}
#adr-info strong, #art-found strong { color: var(--primary); font-weight: 700; }

/* ==================== BOUTON NOUVELLE ADRESSE / ARTICLE ==================== */
.btn-new-adr, .btn-new-art {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    width: 100%; color: #fff; border: none;
    padding: 9px 14px; border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: background .15s;
    font-family: inherit;
}
.btn-new-adr       { background: var(--primary); }
.btn-new-adr:hover { background: var(--primary-dark); }
.btn-new-art       { background: #1e3a5f; }
.btn-new-art:hover { background: #162d4a; }

.art-check-wrap {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px; font-size: .83rem; color: var(--text-dark);
}
.art-check-wrap input[type=checkbox] { accent-color: var(--primary); width: 16px; height: 16px; }

/* Etats vides articles : fusionnés avec #adr-empty / #adr-info ci-dessus */

/* ==================== PAGINATION ==================== */
.pg-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 8px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-white); color: var(--text-dark);
    font-size: .85rem; font-weight: 600; cursor: pointer; transition: all .15s;
}
.pg-btn:hover    { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.pg-btn.active   { background: var(--primary); border-color: var(--primary); color: #fff; }
.pg-btn.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.pg-sep          { color: var(--text-light); font-size: .85rem; padding: 0 4px; line-height: 34px; }

/* ==================== MODAL GENERIQUE ==================== */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 16px 32px;
    overflow-y: auto;
}
.modal-overlay.open { display: flex; }

/* modal-panel : version large (adresses max-width:720px, articles 780px, import 620px) */
.modal-panel {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: 0 24px 72px rgba(0, 0, 0, .28);
    width: 100%;
    max-width: 780px;
    animation: slideIn .18s ease;
}

/* modal-box : version centree (rappels) */
.modal-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    max-width: 740px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-top {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 22px 28px 0; gap: 12px;
}
.modal-top-left { flex: 1; min-width: 0; }
.modal-title { font-size: 1.15rem; font-weight: 800; color: var(--text-dark); margin: 0 0 3px; }
.modal-ref   { font-size: .82rem; color: var(--primary); font-weight: 700; }

/* Bouton fermeture modal -- deux variantes */
.modal-close {
    background: none; border: none; font-size: 1.7rem;
    color: var(--text-light); cursor: pointer; line-height: 1; padding: 0; flex-shrink: 0;
}
.modal-close:hover { color: var(--text-dark); }

/* Header modal (rappels) */
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 22px; border-bottom: 1px solid #e5e7eb;
    position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-header h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }

.modal-body { padding: 20px 22px; }
.modal-footer {
    padding: 12px 22px; border-top: 1px solid #e5e7eb;
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    position: sticky; bottom: 0; background: #fff;
}

/* Stats dans la modale (adresses, articles) */
.modal-stats {
    display: flex; gap: 16px; flex-wrap: wrap; padding: 14px 28px;
    background: var(--bg-light); margin: 14px 28px;
    border-radius: var(--radius-sm); font-size: .85rem;
}
.stat-item  { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-gray); font-weight: 600; }
.stat-val   { font-size: .95rem; font-weight: 700; color: var(--text-dark); }
.stat-val.solde-pos { color: var(--warning); }

/* Onglets dans la modale */
.modal-tabs {
    display: flex; padding: 0 28px; border-bottom: 2px solid var(--border);
    gap: 0; margin-top: 4px;
}
.tab-btn {
    padding: 10px 18px; font-size: .85rem; font-weight: 600;
    color: var(--text-gray); border: none; background: none;
    cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -2px; transition: color .15s;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover  { color: var(--text-dark); }

.tab-panel { display: none; padding: 20px 28px; }
.tab-panel.active { display: block; }

/* Actions dans la modale */
.modal-actions {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 28px 24px; flex-wrap: wrap; gap: 10px;
    border-top: 1px solid var(--border);
}
.modal-actions-left  { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-actions-right { display: flex; gap: 10px; flex-wrap: wrap; }

/* Boutons dans la modale -- style adresses/articles */
.modal-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px; border-radius: var(--radius-sm); font-size: .88rem;
    font-weight: 700; border: none; cursor: pointer; transition: opacity .15s; font-family: inherit;
}
.modal-btn:hover    { opacity: .85; }
.modal-btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-edit   { background: var(--primary); color: #fff; }
.btn-save   { background: var(--success); color: #fff; }
.btn-cancel { background: var(--bg-light); color: var(--text-dark); }
.btn-del    { background: var(--danger-light); color: var(--danger); }
.btn-fac    { background: var(--primary); color: #fff; }

/* Message dans la modale */
.modal-msg { margin: 0 28px 12px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: .88rem; display: none; }
.modal-msg.ok  { background: #dcfce7; color: #15803d; }
.modal-msg.err { background: var(--danger-light); color: var(--danger); }

/* Section title dans modal (rappels, import-paiements) */
.modal-section-title {
    font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
    font-weight: 700; color: #64748b; margin-bottom: 10px;
}

/* Grille 2 colonnes dans modal (rappels) */
.modal-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 14px; }

.modal-info-block { font-size: .875rem; line-height: 1.75; }

/* Textarea dans modal rappels */
.modal-textarea {
    width: 100%; min-height: 68px;
    border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 8px 10px; font-size: .875rem; resize: vertical; box-sizing: border-box;
    font-family: inherit;
}
.modal-textarea:focus { outline: none; border-color: #3b82f6; }

/* ==================== TOAST ==================== */
#toast {
    position: fixed; bottom: 24px; right: 24px; padding: 13px 20px;
    border-radius: var(--radius-sm); font-size: .9rem; font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,.15); display: none; z-index: 9999; max-width: 340px;
}
#toast.success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
#toast.error   { background: var(--danger-light); color: var(--danger); border: 1px solid #fca5a5; }

/* ==================== BADGES ==================== */
/* Base .badge définie dans la section ADMIN USERS (inline-flex) */
.badge-ok   { background: #dcfce7; color: #16a34a; }
.badge-warn { background: #fef9c3; color: #a16207; }
.badge-err  { background: #fee2e2; color: #dc2626; }
.badge-done { background: #dbeafe; color: #1d4ed8; }

.cat-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.nb-badge {
    display: inline-flex; align-items: center; justify-content: center;
    background: #dc2626; color: #fff; border-radius: 999px;
    font-size: .7rem; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px;
}
.retard-dot { width: 8px; height: 8px; border-radius: 50%; background: #dc2626; display: inline-block; margin-right: 4px; }

/* Badges articles */
.art-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; margin-top: 4px; }
.badge-physique  { background: #dbeafe; color: #1d4ed8; }
.badge-forfait   { background: #f1f5f9; color: #64748b; }
.badge-assemblage  { background: #fef9c3; color: #854d0e; }

/* ==================== SPINNERS ==================== */
#parse-spinner {
    display: none; text-align: center; padding: 28px; color: #6366f1; font-size: 1rem;
}
#parse-spinner i {
    font-size: 1.8rem; animation: spin 1s linear infinite; margin-bottom: 8px; display: block;
}

#vs-spinner {
    display: none; color: #6366f1; font-size: 0.9rem;
    align-items: center; gap: 8px;
}
#vs-spinner i { animation: spin 1s linear infinite; }

/* ==================== ZONE DE DEPOT (import-paiements) ==================== */
.drop-zone {
    border: 1px dashed #c7d2fe;
    border-radius: 10px;
    background: #f8f9ff;
    padding: 12px 20px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
    margin-bottom: 20px;
}
.drop-zone.drag-over { border-color: #6366f1; background: #eef2ff; }
.drop-zone input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.drop-icon  { font-size: 1.3rem; color: #6366f1; }
.drop-title { font-size: 0.88rem; font-weight: 600; color: #3730a3; }
.drop-sub   { font-size: 0.78rem; color: #6b7280; }

/* ==================== TABLEAU IMPORT (import-paiements) ==================== */
#results-wrap { display: none; }
.res-title { font-size: 1rem; font-weight: 700; color: #1e293b; margin-bottom: 14px; }
.res-count-label { font-size: 0.82rem; color: #6b7280; margin-left: 8px; font-weight: 400; }

.imp-table { font-size: 0.875rem; }
.imp-table th {
    background: #1e293b; color: #fff;
    padding: 10px 12px; text-align: left;
    font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.imp-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.imp-table tbody tr:hover td { background: #f8fafc; }
.imp-table tr.row-done td { background: #f0fdf4; }
.col-montant { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.col-solde   { text-align: right; font-variant-numeric: tabular-nums; }
.solde-zero  { color: #16a34a; font-weight: 600; }
.solde-pos   { color: #ea580c; font-weight: 600; }

.btn-ventiler {
    background: #6366f1; color: #fff;
    padding: 6px 14px; border-radius: 7px;
    font-size: 0.82rem;
}
.btn-ventiler:hover    { background: #4f46e5; }
.btn-ventiler.disabled { background: #9ca3af; cursor: not-allowed; }

#drop-zone-bottom-wrap { display: none; margin-top: 16px; padding-top: 14px; border-top: 1px solid #e5e7eb; }

/* Finance summary (import-paiements) */
.modal-finance {
    display: flex; gap: 20px; flex-wrap: wrap;
    padding: 16px 24px; background: #f8fafc;
    border-radius: 10px; margin: 16px 24px; font-size: 0.875rem;
}
.fin-item { display: flex; flex-direction: column; gap: 2px; }
.fin-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; font-weight: 600; }
.fin-val   { font-size: 1rem; font-weight: 700; color: #1e293b; }
.fin-val.solde-pos  { color: #ea580c; }
.fin-val.solde-zero { color: #16a34a; }

.modal-section { padding: 0 24px 16px; }

.vers-table { font-size: 0.84rem; }
.vers-table th { background: #f1f5f9; color: #475569; padding: 7px 10px; text-align: left; font-weight: 600; }
.vers-table td { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.vers-table tr:last-child td { border-bottom: none; }
.btn-del-ver {
    background: #fee2e2; color: #dc2626;
    padding: 4px 10px; border-radius: 6px; font-size: 0.76rem;
}
.btn-del-ver:hover { background: #fca5a5; }

.modal-form { padding: 16px 24px 24px; border-top: 1px solid #e5e7eb; margin-top: 4px; }
.modal-form-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; color: #64748b; margin-bottom: 14px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 0.78rem; font-weight: 600; color: #374151; }
.form-group input, .form-group select {
    padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px;
    font-size: 0.9rem; color: #1f2937; background: #fff;
    transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus {
    outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.btn-insert {
    background: #6366f1; color: #fff;
    padding: 11px 24px; border-radius: 10px;
    font-size: 0.9rem; font-weight: 700;
    box-shadow: 0 2px 6px rgba(99,102,241,0.3);
}
.btn-insert:hover    { background: #4f46e5; }
.btn-insert:disabled { background: #a5b4fc; cursor: not-allowed; }

/* ==================== TABLE RAPPELS ==================== */
.rappel-table { font-size: .875rem; }
.rappel-table th {
    padding: 10px 12px; text-align: left;
    background: #f8fafc; color: #64748b;
    font-size: .75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid #e2e8f0;
}
.rappel-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.rappel-table tbody tr:hover td { background: #f8fafc; cursor: pointer; }
.rappel-table tbody tr.retard td { color: #b91c1c; }
.rappel-table tbody tr.retard:hover td { background: #fef2f2; }
.row-hidden { display: none !important; }

/* ==================== FILTRES RAPPELS ==================== */
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-search {
    flex: 1; min-width: 180px;
    padding: 8px 12px; border: 1px solid #e2e8f0;
    border-radius: 8px; font-size: .875rem; outline: none;
    transition: border-color .15s;
}
.filter-search:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,.08); }
.filter-cats { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.filter-cat-label {
    display: flex; align-items: center; gap: 4px;
    font-size: .78rem; font-weight: 600; cursor: pointer;
    padding: 4px 10px; border-radius: 999px; border: 1px solid transparent;
    transition: opacity .15s;
}
.filter-cat-label input { accent-color: #7c3aed; }
/* Etat actif du bouton toggle hors-délais (la classe de base est btn-secondary-custom) */
#btnHorsDelai.active { background: #dc2626; color: #fff; border-color: #dc2626; }

/* Etat solde (rappels, modal) */
.solde-bar {
    display: flex; gap: 0; background: #f8fafc; border-radius: 8px;
    overflow: hidden; border: 1px solid #e2e8f0; font-size: .875rem;
}
.solde-item { flex: 1; text-align: center; padding: 10px 12px; border-right: 1px solid #e2e8f0; }
.solde-item:last-child { border-right: none; }
.solde-val { font-size: 1rem; font-weight: 700; }
.solde-val.rouge { color: #dc2626; }
.solde-lbl { font-size: .68rem; color: #9ca3af; text-transform: uppercase; letter-spacing: .04em; }

.etat-row {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px; border-radius: 6px; margin-bottom: 4px;
    cursor: pointer; border: 1px solid transparent; transition: background .1s;
}
.etat-row:hover { background: #f9fafb; }
.etat-row.actif { background: #eff6ff; border-color: #bfdbfe; }
.etat-label { font-size: .875rem; font-weight: 500; flex: 1; }
.etat-date  { font-size: .75rem; color: #6b7280; }
.etat-radio { accent-color: #3b82f6; width: 15px; height: 15px; cursor: pointer; }

#modal-status { font-size: .8rem; color: #6b7280; margin-left: auto; }
#no-results { text-align: center; padding: 50px 20px; color: #9ca3af; font-size: .95rem; }

.ver-table { font-size: .8rem; }
.ver-table td { padding: 3px 6px; border-bottom: 1px solid #f1f5f9; }

/* ==================== FILTRE / BOUTONS STATISTIQUES VENDEURS ==================== */
.sv-filter-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 28px 32px;
    margin-bottom: 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.sv-filter-card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sv-filter-card h2 i { color: #6366f1; }

.sv-filter-row {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
}
.sv-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sv-filter-group label {
    font-size: .82rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.btn-calculer {
    background: #6366f1;
    color: #fff;
    border-radius: 10px;
    padding: 11px 24px;
    font-size: .95rem;
    height: 44px;
}
.btn-calculer:hover { background: #4f46e5; }

/* ==================== FILTRE / BOUTONS DETAILS VENDEURS ==================== */
.dv-filter-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.dv-filter-card h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 18px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dv-filter-card h2 i { color: #6366f1; }
.dv-filter-row {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    flex-wrap: wrap;
}
.dv-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.dv-filter-group label {
    font-size: .8rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.dv-select {
    height: 44px;
    padding: 0 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: .92rem;
    color: #374151;
    background: #fff;
    min-width: 200px;
    outline: none;
    transition: border-color .15s;
}
.dv-select:focus { border-color: #6366f1; }

/* Boutons indigo communs (details_vendeurs, statistiques-vendeurs) */
.btn-voir {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0 22px;
    height: 44px;
    font-size: .93rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s;
    text-decoration: none;
}
.btn-voir:hover { background: #4f46e5; }

.btn-retour {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 18px;
    height: 44px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
}
.btn-retour:hover { background: #e2e8f0; }

.btn-detail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 11px 20px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    height: 44px;
    transition: background .15s;
}
.btn-detail:hover { background: #e2e8f0; }

/* ==================== BANDEAU PERIODE ==================== */
.dv-periode-bar {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    border-radius: 12px;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .92rem;
    font-weight: 600;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.dv-periode-bar .sep   { opacity: .5; }
.dv-periode-bar .light { opacity: .8; font-weight: 400; }

.sv-periode-bar {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    border-radius: 10px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: 24px;
}
.sv-periode-bar span { opacity: .85; font-weight: 400; margin: 0 4px; }

/* ==================== TABLEAUX DETAILS VENDEURS ==================== */
.dv-fac-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.dv-fac-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}
.dv-fac-num {
    background: #6366f1;
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    border-radius: 8px;
    padding: 4px 10px;
    white-space: nowrap;
}
.dv-fac-client { font-size: .95rem; font-weight: 600; color: #1e293b; }
.dv-fac-id     { margin-left: auto; font-size: .8rem; color: #94a3b8; }

.dv-lig-table { /* base partagée */ }
.dv-lig-table thead th {
    padding: 9px 14px;
    font-size: .76rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
    text-align: left;
    background: #fafafa;
    border-bottom: 1px solid #f1f5f9;
}
.dv-lig-table thead th.right { text-align: right; }
.dv-lig-table tbody tr:hover { background: #f8fafc; }
.dv-lig-table td {
    padding: 9px 14px;
    font-size: .88rem;
    color: #374151;
    border-bottom: 1px solid #f9fafb;
}
.dv-lig-table td.right { text-align: right; font-variant-numeric: tabular-nums; }
.dv-lig-table td.pce   { font-size: .75rem; color: #6366f1; font-weight: 600; }

.dv-fac-footer {
    padding: 10px 18px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 28px;
    flex-wrap: wrap;
    font-size: .88rem;
}
.dv-fac-footer .item            { color: #64748b; }
.dv-fac-footer .item strong     { color: #1e293b; }
.dv-fac-footer .item.net strong { color: #6366f1; font-size: .98rem; }
.dv-fac-footer .item.ver strong { color: #dc2626; }

.dv-grand-total {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #fff;
    border-radius: 12px;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 700;
    margin-top: 8px;
}
.dv-grand-total .montant          { font-size: 1.3rem; color: #a5b4fc; }
.dv-grand-total .montant.negative { color: #fca5a5; }

.dv-empty     { padding: 48px; text-align: center; color: #94a3b8; font-size: .92rem; }
.dv-empty i   { font-size: 2.2rem; display: block; margin-bottom: 10px; color: #e0e7ff; }

/* ==================== STATISTIQUES VENDEURS ==================== */
.sv-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}
.sv-section-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.sv-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}
.sv-section-header h3 { font-size: .95rem; font-weight: 700; color: #1e293b; margin: 0; }
.sv-section-header .badge              { background: #6366f1; color: #fff; font-size: .72rem; font-weight: 700; border-radius: 20px; padding: 3px 10px; margin-left: auto; }
.sv-section-header .badge.green        { background: #10b981; }

.sv-table { /* base partagée */ }
.sv-table thead th {
    background: #f8fafc;
    padding: 10px 16px;
    font-size: .78rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
.sv-table thead th.right { text-align: right; }
.sv-table tbody tr { transition: background .12s; }
.sv-table tbody tr:hover { background: #f8fafc; }
.sv-table tbody tr:nth-child(even) { background: #fafafa; }
.sv-table tbody tr:nth-child(even):hover { background: #f1f5f9; }
.sv-table td { padding: 11px 16px; font-size: .9rem; color: #374151; border-bottom: 1px solid #f1f5f9; }
.sv-table td.amount { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: #1e293b; }
.sv-table td.amount.negative { color: #dc2626; }
.sv-table tfoot td { padding: 12px 16px; font-size: .92rem; font-weight: 700; color: #1e293b; border-top: 2px solid #e5e7eb; background: #f8fafc; }
.sv-table tfoot td.amount { text-align: right; color: #6366f1; }

.sv-empty   { padding: 32px; text-align: center; color: #94a3b8; font-size: .9rem; }
.sv-empty i { font-size: 2rem; display: block; margin-bottom: 8px; }

.vendeur-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #6366f1;
    font-size: .72rem;
    font-weight: 700;
    margin-right: 8px;
    flex-shrink: 0;
}
.vendeur-cell { display: flex; align-items: center; }

/* ==================== VALEUR STOCK ==================== */
.vs-total-card {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 16px;
    padding: 28px 36px;
    margin-bottom: 28px;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.vs-total-label {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 6px;
}
.vs-total-value {
    font-size: 2.4rem;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.vs-total-sub { font-size: 0.82rem; color: #64748b; margin-top: 4px; }
.vs-badge-nb {
    background: rgba(99,102,241,0.25);
    color: #a5b4fc;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

#vs-detail-wrap { display: none; }
.vs-table { font-size: 0.875rem; }
.vs-table thead tr th {
    background: #1e293b; color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.vs-table thead tr th.num { text-align: right; }
.vs-table tbody tr td    { padding: 9px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.vs-table tbody tr:hover td { background: #f8fafc; }
.vs-table tbody tr.cat-row td {
    background: #eef2ff;
    color: #3730a3;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 7px 14px;
}
.vs-table tfoot tr td {
    background: #f1f5f9;
    font-weight: 700;
    padding: 12px 14px;
    border-top: 2px solid #cbd5e1;
    font-size: 0.9rem;
}
.num    { text-align: right; font-variant-numeric: tabular-nums; }
.vs-ref { color: #64748b; font-size: 0.8rem; font-family: monospace; }

/* Date picker zone (valeur-stock) */
.vs-date-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding: 20px 24px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.vs-date-label { font-size: 0.9rem; font-weight: 600; color: #374151; white-space: nowrap; }

.vs-info-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.82rem; color: #6366f1; font-weight: 600;
    text-decoration: none;
}
.vs-info-link:hover { text-decoration: underline; }

/* ==================== INVENTAIRE (actualisation-inventaire) ==================== */
.inv-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.inv-search-wrap { position: relative; margin-bottom: 14px; }
.inv-search-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: #9ca3af; pointer-events: none; font-size: .95rem;
}
.inv-search-input {
    width: 100%; padding: 13px 44px 13px 42px;
    font-size: 1rem; border: 2px solid #e5e7eb;
    border-radius: 10px; font-family: inherit;
    box-sizing: border-box; transition: border-color .2s;
    background: #fff; -webkit-appearance: none;
}
.inv-search-input:focus { outline: none; border-color: #3b82f6; }
.inv-search-clear {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: #9ca3af; cursor: pointer; padding: 4px 6px; font-size: 1rem;
}
.inv-search-clear:hover { color: #374151; }

.inv-cats {
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px;
    margin-bottom: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.inv-cats::-webkit-scrollbar { display: none; }

.inv-cat-pill {
    flex-shrink: 0; padding: 8px 16px;
    border: 2px solid #e5e7eb; border-radius: 20px;
    background: #fff; color: #374151;
    font-size: .82rem; font-weight: 600; cursor: pointer;
    white-space: nowrap; transition: all .15s;
    font-family: inherit; -webkit-tap-highlight-color: transparent;
}
.inv-cat-pill:hover          { border-color: #7c3aed; color: #7c3aed; }
.inv-cat-pill.active         { background: linear-gradient(135deg, #7c3aed, #ec4899); border-color: transparent; color: #fff; box-shadow: 0 2px 8px rgba(124,58,237,.25); }

.inv-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }

.inv-card {
    border: 1.5px solid #e5e7eb; border-radius: 12px;
    overflow: hidden; background: #fff;
    transition: box-shadow .15s, border-color .15s;
}
.inv-card:hover { box-shadow: 0 4px 16px rgba(59,130,246,.1); border-color: #bfdbfe; }
.inv-card.hidden { display: none; }

.inv-card-name { padding: 14px 14px 0; font-size: 1.05rem; font-weight: 700; color: #111827; line-height: 1.35; }
.inv-card-meta {
    padding: 6px 14px 12px; font-size: .78rem; color: #6b7280;
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px; line-height: 1.6;
}
.inv-badge-ref { background: #f3f4f6; color: #374151; padding: 2px 8px; border-radius: 4px; font-weight: 600; font-size: .75rem; }
.inv-meta-sep  { color: #d1d5db; }

.inv-qty-row {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px 14px;
    background: #f9fafb; border-top: 1px solid #f3f4f6;
}
.inv-btn-pm {
    flex-shrink: 0; width: 52px; height: 52px;
    border: 2px solid #e5e7eb; border-radius: 10px;
    background: #fff; color: #374151; font-size: 1.1rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all .12s; -webkit-tap-highlight-color: transparent;
    touch-action: manipulation; user-select: none;
}
.inv-btn-moins:hover, .inv-btn-moins:active { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }
.inv-btn-plus:hover,  .inv-btn-plus:active  { background: #f0fdf4; border-color: #86efac; color: #16a34a; }

.inv-qty-input {
    flex: 1; min-width: 0; height: 52px;
    font-size: 1.8rem; font-weight: 700; text-align: center;
    border: 2px solid #e5e7eb; border-radius: 10px;
    background: #fff; color: #111827; font-family: inherit; padding: 0 4px;
    transition: border-color .2s, background .2s; -moz-appearance: textfield;
}
.inv-qty-input::-webkit-inner-spin-button,
.inv-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.inv-qty-input:focus    { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.inv-qty-input.modified { border-color: #f59e0b; background: #fffbeb; }

.inv-feedback { flex-shrink: 0; width: 30px; text-align: center; font-size: 1.1rem; }

.inv-empty-state { grid-column: 1 / -1; text-align: center; padding: 48px 20px; color: #9ca3af; font-size: 1rem; }
.inv-empty-state i { font-size: 2.2rem; margin-bottom: 14px; display: block; }

/* ==================== PLAN COMPTABLE ==================== */
.comptes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 8px;
}
.comptes-colonne {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}
.comptes-colonne-titre {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 16px;
    font-size: .8125rem;
    font-weight: 700;
    color: #374151;
    letter-spacing: .04em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}
.comptes-groupe-titre {
    padding: 8px 16px 4px;
    font-size: .75rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: .05em;
    text-transform: uppercase;
    border-top: 1px solid #f3f4f6;
    margin-top: 4px;
}
.comptes-groupe-titre:first-of-type { border-top: none; }
.compte-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 16px;
    border-bottom: 1px solid #f9fafb;
}
.compte-row:last-child { border-bottom: none; }
.compte-row:hover      { background: #f9fafb; }
.compte-numero {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #6b7280;
    min-width: 44px;
    font-size: .8125rem;
}
.compte-input {
    flex: 1;
    border: 1px solid transparent;
    border-radius: 5px;
    padding: 4px 7px;
    font-size: .875rem;
    font-family: inherit;
    background: transparent;
    color: #111827;
    transition: border-color .15s, background .15s;
}
.compte-input:hover  { border-color: #d1d5db; background: #fff; }
.compte-input:focus  { border-color: #3b82f6; background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.compte-journal {
    color: #d1d5db;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    text-decoration: none;
    font-size: .875rem;
    transition: color .15s, background .15s;
}
.compte-journal:hover { color: #3b82f6; background: #eff6ff; }

/* Confirmation ob (plan-comptable) */
#ob-confirm-non:hover { background: #f3f4f6; }
#ob-confirm-oui:hover { background: #1d4ed8; }

/* ==================== LANGUAGE SWITCHER (gestion-articles) ==================== */
.lang-switcher { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-bottom: 0; }
.lang-lbl { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--text-gray); letter-spacing: .05em; margin-right: 4px; }
.lang-btn {
    padding: 3px 11px; border-radius: 5px; font-size: .78rem; font-weight: 700;
    border: 1px solid var(--border); background: var(--bg-light); color: var(--text-gray);
    cursor: pointer; transition: all .15s; font-family: inherit; pointer-events: all;
}
.lang-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.lang-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* Layout article 2 colonnes */
.art-2col      { display: flex; gap: 16px; align-items: flex-start; }
.art-left-col  { flex: 0 0 48%; display: flex; flex-direction: column; gap: 12px; }
.art-right-col { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.inline-dims         { display: flex; gap: 6px; align-items: center; }
.inline-dims input   { width: 46px; }
.inline-dims span    { color: var(--text-light); font-size: .8rem; }

/* ==================== ONGLET STOCK (gestion-articles) ==================== */
.stock-info-box {
    background: var(--bg-light); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 16px;
    font-size: .88rem; margin-bottom: 14px;
    display: flex; gap: 20px; flex-wrap: wrap;
}
.stock-info-item { display: flex; flex-direction: column; gap: 2px; }
.stock-info-lbl  { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-gray); }
.stock-info-val  { font-size: 1.1rem; font-weight: 800; color: var(--text-dark); }
.stock-parent-info {
    background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius-sm);
    padding: 8px 12px; font-size: .82rem; margin-bottom: 12px; display: none;
}
.stock-form       { background: var(--bg-light); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 14px; }
.stock-form-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-gray); margin-bottom: 10px; }
.stock-form-row   { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.stock-form-row .field-group { flex: 1; min-width: 120px; margin: 0; }
.stock-form-row .field-group label { margin-bottom: 4px; }
.btn-stock-add {
    background: var(--primary); color: #fff; border: none;
    padding: 8px 14px; border-radius: var(--radius-sm); font-size: .83rem;
    font-weight: 700; cursor: pointer; transition: background .15s; font-family: inherit; white-space: nowrap;
}
.btn-stock-add:hover { background: var(--primary-dark); }
.stock-table { font-size: .78rem; margin-top: 4px; }
.stock-table th {
    background: #f1f5f9; color: var(--text-gray); padding: 6px 8px;
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid var(--border); text-align: left;
}
.stock-table td  { padding: 6px 8px; border-bottom: 1px solid #f8fafc; }
.stock-link      { font-size: .78rem; color: var(--primary); text-decoration: none; }
.stock-link:hover { text-decoration: underline; }

/* ==================== ONGLET COMPOSANTS (gestion-articles) ==================== */
.comp-table { font-size: .83rem; margin-top: 4px; }
.comp-table th {
    background: #f1f5f9; color: var(--text-gray); padding: 7px 10px;
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid var(--border); text-align: left;
}
.comp-table td { padding: 7px 10px; border-bottom: 1px solid #f8fafc; }
.comp-add-form  { background: var(--bg-light); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-top: 14px; }
.comp-add-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-gray); margin-bottom: 10px; }
.comp-search-row { display: flex; gap: 8px; margin-bottom: 8px; }
.comp-search-row input  { flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .83rem; font-family: inherit; }
.comp-search-row button { background: var(--primary); color: #fff; border: none; padding: 7px 12px; border-radius: var(--radius-sm); font-size: .83rem; cursor: pointer; font-family: inherit; }
#comp-search-results { list-style: none; margin: 0; padding: 0; background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 140px; overflow-y: auto; }
#comp-search-results:empty { display: none; }
.comp-selected-lbl { font-size: .83rem; color: var(--primary); font-weight: 600; margin-bottom: 8px; min-height: 18px; }
.comp-qte-row       { display: flex; gap: 8px; align-items: center; }
.comp-qte-row input { width: 80px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .83rem; font-family: inherit; }
.btn-comp-add       { background: #16a34a; color: #fff; border: none; padding: 7px 14px; border-radius: var(--radius-sm); font-size: .83rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.btn-comp-add:hover { background: #15803d; }
.prix-calcule-box   { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius-sm); padding: 8px 12px; font-size: .88rem; margin-bottom: 12px; }
.prix-calcule-box span { font-weight: 700; color: #1d4ed8; }

/* ==================== DATEPICKER LOCK (gestion-adresses) ==================== */
.ob-dp-locked .ob-dp-input { pointer-events: none; cursor: default; color: var(--text-light); }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1400px) {
    .kpi-grid     { grid-template-columns: repeat(3, 1fr); }
    .actions-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1200px) {
    .dashboard-grid   { grid-template-columns: 1fr; }
    .dashboard-grid-3 { grid-template-columns: 1fr; }
    .activity-grid    { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
    .kpi-grid  { grid-template-columns: repeat(2, 1fr); }
    .tips-list { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .config-table,
    .config-table thead,
    .config-table tbody,
    .config-table tr,
    .config-table th,
    .config-table td { display: block; width: 100%; }
    .config-table thead { display: none; }
    .config-table tr { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; overflow: hidden; background: #fff; }
    .config-table td { border-bottom: 1px solid var(--border); }
    .config-table td:last-child { border-bottom: none; }

    .adr-layout      { flex-direction: column; }
    .adr-col-side    { width: 100%; order: -1; position: static; }
    .adr-col-results { width: 100%; }
    .sec-card        { width: 100%; box-sizing: border-box; }
    .col-hide-sm     { display: none; }

    .comptes-grid    { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .secondary-menu { top: 64px; padding: 8px 16px; }
    .main           { padding: 16px; }

    .kpi-grid,
    .actions-grid,
    .activity-grid  { grid-template-columns: 1fr; }

    .filters-bar    { flex-direction: column; align-items: flex-start; }

    .shortcuts-grid { flex-direction: column; }
    .shortcut-btn   { width: 100%; justify-content: center; }

    .menu-icon-item { min-width: 60px; padding: 6px 8px; }
    .menu-icon-item i    { font-size: 1rem; }
    .menu-icon-item span { font-size: 0.6rem; }

    .sv-results-grid { grid-template-columns: 1fr; }
    .sv-filter-row   { flex-direction: column; align-items: stretch; }

    .dv-filter-row { flex-direction: column; align-items: stretch; }
    .dv-select     { min-width: 100%; }

    .vs-total-value { font-size: 1.8rem; }
    .vs-table       { font-size: 0.8rem; }
    .vs-table td, .vs-table th { padding: 7px 8px; }
    .col-cat        { display: none; }

    .imp-table         { font-size: 0.8rem; }
    .imp-table th, .imp-table td { padding: 8px 6px; }
    .col-debtor        { display: none; }
    .form-grid         { grid-template-columns: 1fr; }
    .modal-panel       { max-width: 100%; }
}

@media (max-width: 640px) {
    .field-grid    { grid-template-columns: 1fr; }
    .modal-panel   { max-width: 100%; }
    .modal-top, .modal-tabs, .tab-panel, .modal-actions { padding-left: 16px; padding-right: 16px; }
    /* Onglets : barre defilante horizontale + libelles compacts (evite le debordement quand il y a plusieurs onglets) */
    .modal-tabs    { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; scrollbar-width: none; }
    .modal-tabs::-webkit-scrollbar { display: none; }
    .tab-btn       { padding: 10px 12px; font-size: .8rem; white-space: nowrap; flex: 0 0 auto; }
    .modal-stats   { margin: 14px 16px; }
    .modal-grid-2  { grid-template-columns: 1fr; }
    .art-2col      { flex-direction: column; }
    .art-right-col { width: 100%; }
}

@media (min-width: 600px) {
    .inv-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
    .inv-grid { grid-template-columns: 1fr 1fr 1fr; }
}


/* ============================================================
   FAC-EDIT (edition document)
   Extrait de fac-edit.php
   ============================================================ */

/* ---- Barre d'actions ---- */
.fe-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.fe-topbar-title {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fe-topbar-title span {
    color: #1e40af;
}
.fe-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 7px;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border: none;
    white-space: nowrap;
    text-decoration: none;
}
.fe-btn-back    { background: #f1f5f9; color: #475569; }
.fe-btn-back:hover { background: #e2e8f0; }
.fe-btn-primary { background: #1e40af; color: #fff; }
.fe-btn-primary:hover { background: #1d4ed8; }
.fe-btn-green   { background: #15803d; color: #fff; }
.fe-btn-green:hover { background: #166534; }
.fe-btn-outline { background: #fff; color: #475569; border: 1px solid #e2e8f0; }
.fe-btn-outline:hover { background: #f8fafc; }
.fe-print-dropdown { position: relative; display: inline-block; }
.fe-print-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    min-width: 190px;
    z-index: 100;
    overflow: hidden;
}
.fe-print-menu a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 16px;
    font-size: .82rem;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
}
.fe-print-menu a:last-child { border-bottom: none; }
.fe-print-menu a:hover { background: #f8fafc; color: #1e40af; }
.fe-btn-outline:hover { background: #f8fafc; }

/* ---- Indicateur sauvegarde ---- */
.fe-save-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .75rem;
    color: #94a3b8;
    transition: color .3s;
}
.fe-save-dot.saving { color: #f59e0b; }
.fe-save-dot.saved  { color: #22c55e; }
.fe-save-dot i { font-size: .65rem; }

/* ---- Feuille A4 ---- */
.fe-a4-bg {
    background: #e2e8f0;
    border-radius: 10px;
    padding: 28px 20px 40px;
}
.fe-a4 {
    background: #fff;
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 48px 48px;
    box-shadow: 0 4px 28px rgba(0,0,0,.13);
    border-radius: 3px;
}

/* ---- Section en-tete ---- */
.fe-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 28px;
    padding-bottom: 22px;
}
.fe-header-left { flex: 1; }

/* Type de document (gros, gras) */
.fe-doc-type-sel {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    border: none;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    margin-bottom: 8px;
    display: block;
    -webkit-appearance: none;
    appearance: none;
}
.fe-doc-type-sel:focus { outline: 2px solid #3b82f6; border-radius: 3px; }

/* Grille meta (N°, Date, TVA, Ref) */
.fe-doc-meta {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 3px 6px;
    align-items: center;
    font-size: .84rem;
    color: #1e293b;
}
.fe-meta-label { color: #475569; white-space: nowrap; }
.fe-meta-sep   { color: #94a3b8; }
.fe-meta-bold  { font-weight: 700; }

.fe-field-inline {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 3px 7px;
    font-size: .82rem;
    font-family: inherit;
    color: #1e293b;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .15s, background .15s;
}
.fe-field-inline:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
}
.fe-field-ro {
    font-size: .84rem;
    color: #1e293b;
}
select.fe-field-inline { cursor: pointer; }

/* Champs meta inline (petits) */
input.fe-meta-input {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: .82rem;
    font-family: inherit;
    color: #1e293b;
    width: 130px;
    box-sizing: border-box;
}
input.fe-meta-input:focus { outline: none; border-color: #3b82f6; background: #fff; }
select.fe-meta-input { cursor: pointer; width: 160px; }

/* ---- Bloc adresse client ---- */
.fe-client-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
    width: 38%;
}
.fe-client-block {
    width: 100%;
    padding: 12px 16px;
    background: #f8fafc;
    border-left: 3px solid #cbd5e1;
    font-size: .83rem;
    line-height: 1.7;
    color: #1e293b;
    border-radius: 0 6px 6px 0;
    box-sizing: border-box;
}
.fe-client-block strong { font-size: .85rem; }
.fe-btn-chg-adr {
    flex-shrink: 0;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: .78rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    font-family: inherit;
}
.fe-btn-chg-adr:hover { background: #e2e8f0; }

/* ---- Concerne ---- */
.fe-concerne-wrap { margin-bottom: 22px; display: flex; gap: 0; }
.fe-concerne-inner { width: 50%; }
.fe-label-section {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #94a3b8;
    margin-bottom: 5px;
}
textarea.fe-field-inline {
    width: 100%;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}

/* ---- Tableau lignes ---- */
.fe-lines-section { margin-bottom: 24px; }
.fe-lines-table {
    width: 100%;
    border-collapse: separate;   /* separate permet overflow:visible sur td (compat Safari) */
    border-spacing: 0;           /* visuellement identique a collapse */
    font-size: .8rem;
}
.fe-lines-table thead tr {
    background: transparent;
    color: #475569;
}
.fe-lines-table thead th {
    border-top: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
}
.fe-lines-table th {
    padding: 6px 8px;
    font-weight: 600;
    font-size: .74rem;
    letter-spacing: .02em;
    white-space: nowrap;
}
.fe-lines-table td {
    padding: 3px 4px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.fe-lines-table tbody tr:hover td { background: #f8fafc; }
.fe-line-input {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: .8rem;
    font-family: inherit;
    background: transparent;
    color: #1e293b;
    box-sizing: border-box;
}
.fe-line-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
}
select.fe-line-input { cursor: pointer; }
.fe-line-input.num { text-align: right; }
.fe-drag-handle {
    cursor: grab;
    color: #cbd5e1;
    padding: 0 4px;
    font-size: .85rem;
}
.fe-drag-handle:active { cursor: grabbing; }
.sortable-chosen td { background: #eff6ff !important; }
.sortable-ghost   td { opacity: .4; }
.fe-del-line {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: .8rem;
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    z-index: 10;
}
.fe-del-line:hover { color: #ef4444; background: #fee2e2; }
/* Cellule largeur 0 — overflow visible pour que le bouton déborde (compat Chrome + Safari) */
.fe-lines-table td.fe-del-cell {
    width: 0;
    padding: 0;
    border: none;
    position: relative;
    overflow: visible;
}
.fe-add-line-row td {
    padding: 8px 4px 0;
}
.fe-add-line-input {
    border: 1px dashed #cbd5e1;
    border-radius: 5px;
    padding: 5px 9px;
    font-size: .8rem;
    font-family: inherit;
    color: #1e293b;
    background: #fafafa;
    width: 100%;
    box-sizing: border-box;
}
.fe-add-line-input:focus { outline: none; border-color: #3b82f6; background: #fff; }
.fe-add-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.fe-art-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.fe-art-search-icon {
    position: absolute;
    left: 9px;
    color: #94a3b8;
    font-size: .78rem;
    pointer-events: none;
}
.fe-art-ref-input {
    width: 240px;
    padding: 7px 10px 7px 28px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: .82rem;
    font-family: inherit;
    background: #f8fafc;
    color: #1e293b;
    transition: border-color .15s;
}
.fe-art-ref-input:focus { outline: none; border-color: #3b82f6; background: #fff; }
/* Dropdown résultats */
.fe-art-drop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 340px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    z-index: 300;
    overflow: hidden;
}
.fe-art-drop-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: .82rem;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    outline: none;
}
.fe-art-drop-item:last-child { border-bottom: none; }
.fe-art-drop-item:hover,
.fe-art-drop-item:focus { background: #eff6ff; }
.fe-art-drop-ref {
    font-weight: 600;
    color: #3b82f6;
    white-space: nowrap;
    min-width: 60px;
}
.fe-art-drop-lib {
    flex: 1;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fe-art-drop-prix {
    white-space: nowrap;
    color: #64748b;
    font-size: .78rem;
}
.fe-art-drop-empty {
    padding: 10px 12px;
    font-size: .82rem;
    color: #94a3b8;
    font-style: italic;
}
.fe-btn-add-line {
    background: #f1f5f9;
    border: 1px dashed #94a3b8;
    border-radius: 6px;
    padding: 7px 16px;
    font-size: .8rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.fe-btn-add-line:hover { background: #e2e8f0; border-color: #475569; color: #1e293b; }
.fe-designation-row td {
    padding: 0 4px 4px;
}
.fe-designation-row { display: none; }
.fe-designation-row.visible { display: table-row; }
.fe-expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: .7rem;
    padding: 0 3px;
}
.fe-expand-btn:hover { color: #475569; }

/* ---- Totaux ---- */
.fe-totaux-wrap {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}
.fe-totaux {
    width: 300px;
    font-size: .84rem;
}
.fe-tot-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}
.fe-tot-row.ttc {
    font-weight: 700;
    font-size: .95rem;
    color: #0f172a;
    border-top: 2px solid #1e40af;
    border-bottom: 2px solid #1e40af;
    padding: 7px 8px;
    margin-top: 4px;
}
.fe-tot-row.solde {
    font-weight: 700;
    color: #b91c1c;
}
.fe-tot-input {
    width: 70px;
    text-align: right;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: .8rem;
    font-family: inherit;
}
.fe-tot-input:focus { outline: none; border-color: #3b82f6; }

/* ---- Remerciement / Conditions ---- */
.fe-footer-fields { margin-top: 20px; border-top: 1px solid #f1f5f9; padding-top: 18px; }

/* ---- Totaux ligne horizontale ---- */
.fe-totaux-line {
    display: flex;
    align-items: stretch;
    border-top: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
    margin: 10px 0 20px;
    flex-wrap: wrap;
}
.fe-tot-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 10px;
    border-right: 1px solid #e2e8f0;
    min-width: 90px;
}
.fe-tot-cell:last-child { border-right: none; }
.fe-tot-lbl {
    font-size: .7rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: 3px;
    white-space: nowrap;
}
.fe-tot-val {
    font-size: .88rem;
    font-weight: 600;
    color: #1e293b;
}
.fe-tot-cell-ttc {
    background: #f8fafc;
}
.fe-tot-cell-ttc .fe-tot-val {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}
.fe-tot-cell-solde .fe-tot-val { color: #b91c1c; font-weight: 700; }
.fe-tot-mini-input {
    width: 42px;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 1px 4px;
    font-size: .7rem;
    font-family: inherit;
    text-align: right;
}
.fe-tot-mini-input:focus { outline: none; border-color: #3b82f6; }

/* ---- Spinner ---- */
.fe-spin { color: #94a3b8; font-size: .8rem; }

/* ---- Impression ---- */
.fe-printed-banner {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 7px;
    padding: 9px 16px;
    font-size: .82rem;
    color: #9a3412;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
/* ---- Blocage compta ---- */
.compta-locked .fe-lines-table input,
.compta-locked .fe-lines-table select,
.compta-locked .fe-lines-table textarea {
    pointer-events: none;
    background: #f8fafc !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
}
.compta-locked .fe-add-bar { display: none !important; }
.compta-locked .fe-btn-del-ligne { display: none !important; }
.compta-locked .fe-btn-chg-adr   { display: none !important; }
.compta-locked #rabais_fac,
.compta-locked #escompte_fac {
    pointer-events: none;
    background: #f8fafc !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
}
/* ---- Blocage ---- */
.fe-locked-banner {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 7px;
    padding: 10px 16px;
    font-size: .82rem;
    color: #92400e;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- Modal recherche adresse ---- */
.fe-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15,23,42,.45);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.fe-modal-box {
    background: #fff;
    border-radius: 10px;
    width: 500px;
    max-width: 100%;
    max-height: calc(100vh - 40px);
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
/* En-tête unifié — sobre, corporate */
.fe-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: .92rem;
    color: #1e293b;
    flex-shrink: 0;
}
/* Variante warning (document déjà imprimé) */
.fe-modal-head-warn {
    background: #fef3c7;
    border-bottom-color: #fde68a;
    color: #92400e;
}
.fe-modal-close {
    background: none; border: none; cursor: pointer;
    font-size: 1.3rem; color: #94a3b8; padding: 2px 8px;
    border-radius: 4px; line-height: 1; flex-shrink: 0;
}
.fe-modal-close:hover { background: #f1f5f9; color: #475569; }
.fe-modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.fe-modal-body input[type=text]:not(.ob-dp-input) {
    width: 100%; box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: .88rem;
    outline: none;
}
.fe-modal-body input[type=text]:not(.ob-dp-input):focus { border-color: #003399; box-shadow: 0 0 0 3px rgba(0,51,153,.12); }
/* Pied de modal : boutons */
.fe-modal-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 18px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.fe-modal-foot-split { justify-content: space-between; }
.fe-adr-results { margin-top: 12px; max-height: 320px; overflow-y: auto; }
.fe-adr-item {
    padding: 9px 12px;
    cursor: pointer;
    border-radius: 6px;
    font-size: .84rem;
    color: #374151;
    border: 1px solid #e5e7eb;
    margin-bottom: 5px;
    transition: background .12s;
}
.fe-adr-item:hover { background: #eff6ff; border-color: #bfdbfe; }
.fe-adr-item strong { display: block; font-size: .87rem; color: #1e40af; margin-bottom: 2px; }
.fe-adr-empty { color: #9ca3af; font-size: .84rem; padding: 10px 0; text-align: center; }


/* ============================================================
   GESTION DOCUMENTS
   Extrait de gestion-documents.php
   ============================================================ */

/* ---- Badges type document ---- */
/* Tri colonnes */
.th-sort {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.th-sort:hover { background: #f0f9ff; }
.sort-icon { font-size: .65rem; margin-left: 3px; color: #94a3b8; vertical-align: middle; }
.sort-icon.active-asc  { color: #3b82f6; }
.sort-icon.active-desc { color: #3b82f6; }
/* Z-index sticky sidebar sous la navbar (z-index:100) */
.adr-col-side { z-index: 1; }

.doc-badge {

    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
}
.badge-fac { background: #dbeafe; color: #1d4ed8; }
.badge-off { background: #dcfce7; color: #15803d; }
.badge-rap { background: #fef9c3; color: #a16207; }
.badge-avo { background: #fce7f3; color: #be185d; }
.badge-aut { background: #f1f5f9; color: #475569; }

/* ---- Statut paiement ---- */
.statut-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    font-weight: 500;
}
.statut-dot::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.statut-paye   { color: #15803d; }
.statut-paye::before   { background: #22c55e; }
.statut-ouvert { color: #1d4ed8; }
.statut-ouvert::before { background: #3b82f6; }
.statut-bloque { color: #64748b; }
.statut-bloque::before { background: #94a3b8; }

/* ---- Num&eacute;ro document ---- */
.doc-num-cell { white-space: nowrap; }
.doc-client-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.doc-concerne-cell { color: var(--text-light); font-size: .83rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.doc-del-btn {
    background: none; border: none; cursor: pointer; padding: 2px 6px;
    border-radius: 4px; line-height: 1;
}
.doc-del-btn:hover { background: #fee2e2; }

/* ---- Num&eacute;ro document ---- */
.doc-num {
    font-family: 'Inter', monospace;
    font-size: .78rem;
    color: var(--text-light);
    white-space: nowrap;
}
.doc-prenumero {
    display: inline-block;
    font-size: .7rem;
    color: var(--text-light);
}

/* ---- Client dans le tableau ---- */
.doc-client-name {
    font-weight: 500;
    font-size: .85rem;
}
.doc-client-sub {
    font-size: .74rem;
    color: var(--text-light);
}

/* ---- Filtres suppl&eacute;mentaires ---- */
/* Listes radios type + ann&eacute;e */
.filter-col-lbl   { font-size:.66rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:#64748b; margin-bottom:5px; }
.filter-radio-row { display:flex; align-items:flex-start; gap:4px; margin-bottom:4px; cursor:pointer; font-size:.78rem; color:#1e293b; line-height:1.3; }
.filter-radio-row input[type=radio] { margin:1px 0 0; flex-shrink:0; accent-color:#1e40af; }
.filter-radio-row span { word-break:break-word; }
.filter-radio-row input[type=radio]:checked + span { color:#1e40af; font-weight:700; }

/* Bouton Afficher */
.btn-afficher { display:block; width:100%; padding:8px 14px; background:#1e40af; color:#fff; border:none; border-radius:6px; font-size:.83rem; font-weight:700; cursor:pointer; font-family:inherit; text-align:center; letter-spacing:.02em; }
.btn-afficher:hover { background:#1d4ed8; }

.doc-filter-row {
    display: flex;
    gap: 6px;
    margin-top: 7px;
}
.doc-filter-row select {
    flex: 1;
    min-width: 0;
}

/* ============================================
   PANNEAU DOCUMENT (bas de page)
   ============================================ */
.doc-panel {
    margin-top: 22px;
    display: none;
}
.doc-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}
.doc-panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.doc-panel-close {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    color: var(--text-light);
    font-size: .8rem;
    transition: background .15s;
}
.doc-panel-close:hover { background: #f1f5f9; }

/* ---- Simulation A4 ---- */
.a4-wrapper {
    background: #e2e8f0;
    padding: 28px 20px;
    border-radius: 8px;
    min-height: 320px;
}
.a4-sheet {
    background: #fff;
    max-width: 794px;
    margin: 0 auto;
    padding: 40px 48px;
    box-shadow: 0 4px 24px rgba(0,0,0,.13), 0 1px 4px rgba(0,0,0,.07);
    border-radius: 2px;
    min-height: 260px;
    position: relative;
}
.a4-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #94a3b8;
    text-align: center;
    gap: 12px;
}
.a4-placeholder i {
    font-size: 2.4rem;
    color: #cbd5e1;
}
.a4-placeholder p {
    font-size: .9rem;
    margin: 0;
}
.a4-placeholder .a4-ph-sub {
    font-size: .78rem;
    color: #b4c1d1;
}

/* ---- Contenu document charg&eacute; ---- */
.doc-loaded-header {
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 18px;
    margin-bottom: 18px;
}
.doc-loaded-meta {
    font-size: .8rem;
    color: var(--text-light);
    margin-bottom: 4px;
}
.doc-loaded-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}
.doc-loaded-client {
    margin-top: 8px;
    font-size: .88rem;
    color: var(--text);
}
.doc-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 20px;
    font-size: .82rem;
    margin-top: 14px;
}
.doc-info-grid dt {
    color: var(--text-light);
    font-weight: 500;
}
.doc-info-grid dd {
    margin: 0;
    color: var(--text);
    font-weight: 600;
}

/* ---- Spinner panneau ---- */
.doc-panel-spin {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    color: var(--primary);
    font-size: .9rem;
}

/* ============================================
   STYLES DOCUMENT A4
   ============================================ */
.a4-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    gap: 20px;
}
.a4-soc {
    font-size: .82rem;
    line-height: 1.6;
    color: #1e293b;
}
.a4-soc strong { font-size: .9rem; }
.a4-docref {
    text-align: right;
    font-size: .82rem;
    color: #1e293b;
    line-height: 1.7;
}
.a4-doctype {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e40af;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}
.a4-docnum {
    font-size: .95rem;
    font-weight: 600;
    color: #0f172a;
}
.a4-docdate { color: #475569; }
.a4-client-block {
    margin: 20px 0 22px 0;
    padding: 14px 18px;
    background: #f8fafc;
    border-left: 3px solid #cbd5e1;
    font-size: .88rem;
    line-height: 1.65;
    color: #1e293b;
}
.a4-concerne {
    margin: 0 0 20px 0;
    font-size: .85rem;
    color: #334155;
    line-height: 1.6;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
}
.a4-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
    margin-bottom: 18px;
}
.a4-table thead tr {
    background: #1e40af;
    color: #fff;
}
.a4-table th {
    padding: 7px 10px;
    font-weight: 600;
    font-size: .78rem;
    letter-spacing: .02em;
}
.a4-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
    color: #1e293b;
}
.a4-table tbody tr:nth-child(even) td { background: #f8fafc; }
.a4-totaux {
    margin-left: auto;
    width: 280px;
    font-size: .85rem;
    margin-bottom: 20px;
}
.a4-tot-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}
.a4-tot-ttc {
    font-weight: 700;
    font-size: .95rem;
    color: #0f172a;
    border-top: 2px solid #1e40af;
    border-bottom: 2px solid #1e40af;
    padding: 7px 8px;
    margin-top: 4px;
}
.a4-tot-solde {
    font-weight: 700;
    color: #b91c1c;
    border-bottom: 2px solid #b91c1c;
    padding: 6px 8px;
}
.a4-remerciement {
    margin: 16px 0;
    font-size: .82rem;
    color: #475569;
    font-style: italic;
}
.a4-cond {
    margin-top: 18px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: .8rem;
    color: #475569;
}
.a4-cond-titre {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}
.a4-vers {
    margin-top: 18px;
}
.a4-vers-titre {
    font-weight: 600;
    font-size: .82rem;
    color: #1e293b;
    margin-bottom: 6px;
}
.a4-mep-entete {
    border-bottom: 2px solid #1e40af;
    margin-bottom: 22px;
    padding-bottom: 10px;
    font-size: .8rem;
    color: #475569;
}
.a4-mep-pied {
    border-top: 1px solid #e2e8f0;
    margin-top: 28px;
    padding-top: 10px;
    font-size: .75rem;
    color: #94a3b8;
    text-align: center;
}

/* ============================================
   MODAL CHOIX TYPE
   ============================================ */
.modal-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    padding: 18px 20px 20px;
}
.modal-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}
.modal-type-btn:hover {
    border-color: var(--primary);
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}
.modal-type-btn i {
    font-size: 1.5rem;
    color: var(--primary);
}

/* ============================================
   MODAL RECHERCHE CLIENT
   ============================================ */
.client-search-wrap {
    padding: 16px 20px 0;
}
.client-search-input {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    font-size: .88rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color .15s;
}
.client-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.client-results-list {
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 0 20px 16px;
}
.client-result-item {
    padding: 9px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .12s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.client-result-item:hover { background: #f1f5f9; }
.client-result-item i { color: var(--primary); font-size: .85rem; flex-shrink: 0; }
.client-result-name { font-weight: 600; font-size: .85rem; color: var(--text); }
.client-result-sub  { font-size: .74rem; color: var(--text-light); }
.client-no-result {
    text-align: center;
    color: var(--text-light);
    font-size: .82rem;
    padding: 20px 0;
}
.client-spin {
    text-align: center;
    padding: 20px 0;
    color: var(--primary);
}

/* ---- Nouveau document placeholder (dans A4) ---- */
.new-doc-placeholder {
    padding: 24px 0 10px;
}
.new-doc-placeholder .ndp-label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 4px;
}
.new-doc-placeholder .ndp-val {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}
.new-doc-placeholder .ndp-type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: .78rem;
    font-weight: 600;
    background: #dbeafe;
    color: #1d4ed8;
    margin-bottom: 20px;
}
.new-doc-placeholder .ndp-info {
    font-size: .82rem;
    color: var(--text-light);
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 7px;
    padding: 14px 16px;
}


/* ============================================================
   ADMIN USERS (superadmin)
   Extrait de admin-users.php
   ============================================================ */

.admin-wrap { max-width:1200px; margin:30px auto; padding:0 20px; }
.admin-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:24px; flex-wrap:wrap; gap:12px; }
.admin-title { font-size:1.4rem; font-weight:700; color:#1e293b; display:flex; align-items:center; gap:10px; }
.users-table { background:#fff; border-radius:12px; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,.08); font-size:.9rem; }
.users-table thead { background:#f8fafc; }
.users-table th { padding:12px 14px; text-align:left; font-weight:600; color:#64748b; font-size:.82rem; text-transform:uppercase; letter-spacing:.04em; border-bottom:1px solid #e2e8f0; white-space:nowrap; }
.users-table td { padding:11px 14px; border-bottom:1px solid #f1f5f9; vertical-align:middle; color:#334155; }
.users-table tr:last-child td { border-bottom:none; }
.users-table tr:hover td { background:#f8fafc; }
.badge { display:inline-flex; align-items:center; gap:5px; padding:3px 10px; border-radius:20px; font-size:.78rem; font-weight:600; }
.badge-green  { background:#dcfce7; color:#15803d; }
.badge-red    { background:#fee2e2; color:#dc2626; }
.badge-blue   { background:#dbeafe; color:#1d4ed8; }
.badge-gray   { background:#f1f5f9; color:#64748b; }
.badge-orange { background:#ffedd5; color:#c2410c; }
.btn-icon { background:none; border:1px solid #e2e8f0; border-radius:7px; padding:5px 9px; cursor:pointer; color:#64748b; font-size:.85rem; transition:all .15s; }
.btn-icon:hover { background:#f1f5f9; color:#1e293b; }
.btn-icon.danger:hover { background:#fee2e2; color:#dc2626; border-color:#fca5a5; }
.btn { display:inline-flex; align-items:center; gap:8px; padding:9px 18px; border-radius:8px; font-weight:600; font-size:.9rem; cursor:pointer; border:none; transition:all .15s; }
.btn-primary { background:#3b82f6; color:#fff; }
.btn-primary:hover { background:#2563eb; }
/* Modal */
.modal-overlay.active { display:flex; }
.modal-box { background:#fff; border-radius:16px; width:100%; max-width:600px; max-height:90vh; overflow-y:auto; box-shadow:0 20px 60px rgba(0,0,0,.2); }
.modal-header { padding:20px 24px; border-bottom:1px solid #e2e8f0; display:flex; align-items:center; justify-content:space-between; }
.modal-header h2 { font-size:1.1rem; font-weight:700; color:#1e293b; margin:0; }
.modal-body { padding:24px; }
.modal-footer { padding:16px 24px; border-top:1px solid #e2e8f0; display:flex; justify-content:flex-end; gap:10px; }
.form-group { margin-bottom:16px; }
.form-group label { display:block; font-weight:600; font-size:.85rem; color:#374151; margin-bottom:5px; }
.form-group input, .form-group select { width:100%; padding:9px 12px; border:1px solid #d1d5db; border-radius:8px; font-size:.9rem; font-family:inherit; box-sizing:border-box; }
.form-group input:focus, .form-group select:focus { outline:none; border-color:#3b82f6; box-shadow:0 0 0 3px rgba(59,130,246,.12); }
.rights-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.rights-section { margin-bottom:16px; }
.rights-section h4 { font-size:.82rem; font-weight:700; color:#64748b; text-transform:uppercase; letter-spacing:.05em; margin:0 0 8px; }
.rights-checkbox { display:flex; align-items:center; gap:8px; padding:6px 0; font-size:.88rem; cursor:pointer; }
.rights-checkbox input[type=checkbox] { width:15px; height:15px; cursor:pointer; }
.flash { padding:12px 16px; border-radius:8px; margin-bottom:20px; font-size:.9rem; display:flex; align-items:center; gap:8px; }
.flash-ok  { background:#f0fdf4; border-left:4px solid #22c55e; color:#15803d; }
.flash-err { background:#fef2f2; border-left:4px solid #ef4444; color:#dc2626; }
/* Navbar simple */
.admin-navbar { background:#1e293b; padding:0 24px; height:56px; display:flex; align-items:center; justify-content:space-between; }
.admin-navbar .logo { color:#fff; font-weight:700; font-size:1.05rem; text-decoration:none; display:flex; align-items:center; gap:10px; }
.admin-navbar .logo-dot { color:#3b82f6; }
.admin-navbar .nav-logout { color:#94a3b8; text-decoration:none; font-size:.85rem; display:flex; align-items:center; gap:6px; }
.admin-navbar .nav-logout:hover { color:#fff; }


/* ============================================================
   GESTION UTILISATEURS
   Extrait de gestion-utilisateurs.php
   (table, badges, buttons, modal, form, rights : partagés avec ADMIN USERS ci-dessus)
   ============================================================ */

/* ---- Layout (propre à gestion-utilisateurs) ---- */
.gu-wrap { max-width:1200px; margin:30px auto; padding:0 20px; }
.gu-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:24px; flex-wrap:wrap; gap:12px; }
.gu-title { font-size:1.4rem; font-weight:700; color:#1e293b; display:flex; align-items:center; gap:10px; }

/* ---- Modal close (propre à gestion-utilisateurs) ---- */
.modal-close-btn { background:none; border:none; font-size:1.3rem; cursor:pointer; color:#94a3b8; line-height:1; padding:0; }
.modal-close-btn:hover { color:#1e293b; }

/* ---- Dropdown actions ---- */
.au-actions   { position:relative; display:inline-block; }
.au-toggle-btn { background:#f8fafc; border:1px solid #cbd5e1; border-radius:6px;
                 padding:6px 12px; font-size:.82rem; cursor:pointer; color:#334155;
                 font-family:inherit; white-space:nowrap; }
.au-toggle-btn:hover { background:#e2e8f0; }
.au-dropdown  { position:fixed; min-width:220px;
                background:#fff; border:1px solid #e2e8f0; border-radius:8px;
                box-shadow:0 4px 16px rgba(0,0,0,.12); z-index:9999; overflow:hidden; }
.au-item      { display:flex; align-items:center; gap:9px; padding:9px 14px;
                font-size:.85rem; color:#334155; text-decoration:none; width:100%;
                background:none; border:none; cursor:pointer; font-family:inherit;
                text-align:left; white-space:nowrap; box-sizing:border-box; }
.au-item:hover { background:#f1f5f9; }
.au-item-btn  { width:100%; }
.au-item-danger { color:#dc2626; }
.au-item-danger:hover { background:#fef2f2; }
.au-separator { border-top:1px solid #e2e8f0; margin:4px 0; }

/* ---- Inline edit ---- */
.ie-wrap    { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.ie-pencil  { color:#94a3b8; font-size:.75rem; text-decoration:none; flex-shrink:0; }
.ie-pencil:hover { color:#3b82f6; }
.ie-zone    { display:flex; align-items:center; gap:4px; }
.ie-input   { border:1px solid #cbd5e1; border-radius:5px; padding:4px 7px; font-size:.85rem;
              font-family:inherit; outline:none; width:160px; }
.ie-input:focus { border-color:#3b82f6; box-shadow:0 0 0 2px rgba(59,130,246,.15); }
.ie-btn-ok  { background:#22c55e; color:#fff; border:none; border-radius:5px;
              padding:4px 8px; cursor:pointer; font-size:.8rem; }
.ie-btn-cancel { background:#e2e8f0; color:#475569; border:none; border-radius:5px;
                 padding:4px 8px; cursor:pointer; font-size:.8rem; }

/* ---- Search bar ---- */
.au-search-bar   { display:flex; align-items:center; gap:14px; margin-bottom:16px; flex-wrap:wrap; }
.au-search-wrap  { position:relative; flex:1; min-width:240px; max-width:500px; }
.au-search-icon  { position:absolute; left:12px; top:50%; transform:translateY(-50%);
                   color:#94a3b8; font-size:.85rem; pointer-events:none; }
.au-search-input { width:100%; border:1px solid #e2e8f0; border-radius:8px;
                   padding:9px 36px 9px 34px; font-size:.88rem; font-family:inherit;
                   outline:none; background:#fff; box-sizing:border-box; }
.au-search-input:focus { border-color:#3b82f6; box-shadow:0 0 0 3px rgba(59,130,246,.12); }
.au-search-clear { position:absolute; right:10px; top:50%; transform:translateY(-50%);
                   background:none; border:none; color:#94a3b8; cursor:pointer;
                   font-size:.8rem; padding:2px 4px; }
.au-search-clear:hover { color:#475569; }
.au-search-count { font-size:.82rem; color:#94a3b8; white-space:nowrap; }
.au-user-row.au-hidden { display:none; }

/* ---- Help button ---- */
.btn-aide { background:#f1f5f9; border:1px solid #cbd5e1; border-radius:7px;
            padding:8px 16px; font-size:.85rem; cursor:pointer; color:#475569;
            font-family:inherit; display:flex; align-items:center; gap:7px; }
.btn-aide:hover { background:#e2e8f0; color:#1e293b; }

/* ---- Aide sections ---- */
.aide-section { background:#f8fafc; border:1px solid #e2e8f0; border-radius:8px;
                padding:14px 16px; margin-bottom:14px; }
.aide-section h3 { font-size:.9rem; font-weight:600; color:#1e293b;
                   margin:0 0 8px; display:flex; align-items:center; gap:8px; }
.aide-section p { font-size:.85rem; color:#475569; margin:0; line-height:1.6; }
.aide-section ul { font-size:.85rem; color:#475569; margin:8px 0 0 0; padding-left:18px; line-height:1.8; }
kbd { background:#e2e8f0; border:1px solid #cbd5e1; border-radius:4px;
      padding:1px 6px; font-size:.8rem; font-family:monospace; }


/* ============================================================
   TABLEAU DE BORD (quickbar, actions)
   Extrait de tableau-de-bord.php
   ============================================================ */

/* ---- Actions rapides ---- */
.quickbar {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.quickbar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}
.quickbar-section-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.quickbar-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #94a3b8;
    margin-bottom: 14px;
}
.quickbar-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}
.qb-grid-4 {
    grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 800px) {
    .qb-grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 576px) {
    .quickbar-grid,
    .qb-grid-4 { grid-template-columns: 1fr; }
}
.qb-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    background: #f8fafc;
}
.qb-card-title {
    font-size: .78rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.qb-card-title i { color: var(--primary); }
.qb-btns { display: flex; flex-wrap: wrap; gap: 7px; }
.qb-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border-radius: 7px;
    border: 1px solid #cbd5e1;
    background: #fff;
    font-size: .78rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.qb-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.qb-btn:hover i { color: #fff; }
.qb-btn i { color: var(--primary); font-size: .8rem; }
.qb-btn.qb-btn-full { width: 100%; justify-content: center; }

/* Barre de recherche globale */
.quickbar-search { position: relative; }
.quickbar-search input {
    width: 100%;
    padding: 11px 46px 11px 18px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: .92rem;
    font-family: inherit;
    color: #1e293b;
    background: #f8fafc;
    box-sizing: border-box;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.quickbar-search input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(0,51,153,.08); }

/* Recherches récentes */
.qs-recent {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}
.qs-recent-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #94a3b8;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.qs-recent-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.qs-recent-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: .78rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .15s, background .15s, color .15s;
}
.qs-recent-tag:hover { background: #eff6ff; border-color: var(--primary); color: var(--primary); }
.qs-recent-tag i { font-size: .7rem; color: #94a3b8; }
.qs-recent-tag:hover i { color: var(--primary); }
.qs-recent-del {
    font-size: .78rem;
    color: #94a3b8;
    margin-left: 2px;
    line-height: 1;
    padding: 0 1px;
    border-radius: 50%;
    transition: color .15s;
}
.qs-recent-del:hover { color: #dc2626; }
.quickbar-search .qs-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}
.qs-results {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 200;
    max-height: 400px;
    overflow-y: auto;
}
.qs-group-title {
    padding: 8px 14px 4px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #94a3b8;
    border-top: 1px solid #f1f5f9;
}
.qs-group-title:first-child { border-top: none; }
.qs-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: .82rem;
    color: #1e293b;
    text-decoration: none;
    transition: background .1s;
}
.qs-item:hover { background: #f1f5f9; color: #1e293b; text-decoration: none; }
.qs-item i { color: var(--primary); width: 14px; flex-shrink: 0; }
.qs-item-sub { font-size: .74rem; color: #94a3b8; margin-left: auto; white-space: nowrap; }
.qs-empty { padding: 16px 14px; font-size: .82rem; color: #94a3b8; text-align: center; }

/* Modal client (dashboard) */
.qb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 300;
    align-items: center;
    justify-content: center;
}
.qb-overlay.open { display: flex; }
.qb-modal {
    background: #fff;
    border-radius: 14px;
    width: 420px;
    max-width: 95vw;
    padding: 24px;
    box-shadow: 0 12px 40px rgba(0,0,0,.2);
}
.qb-modal-title { font-size: 1rem; font-weight: 700; color: #0f172a; margin-bottom: 4px; }
.qb-modal-sub { font-size: .8rem; color: #64748b; margin-bottom: 16px; }
.qb-modal input {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: .85rem;
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 10px;
}
.qb-modal input:focus { outline: none; border-color: var(--primary); }
.qb-modal-items { max-height: 220px; overflow-y: auto; }
.qb-modal-item {
    padding: 9px 12px;
    border-radius: 7px;
    cursor: pointer;
    font-size: .83rem;
    color: #1e293b;
    transition: background .1s;
}
.qb-modal-item:hover { background: #f1f5f9; }
.qb-modal-close {
    float: right;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #94a3b8;
    margin-top: -4px;
}


/* ============================================================
   COMPTABILITE (journaux) - styles specifiques
   ============================================================ */

/* --- Selecteur dropdown --- */
.jc-select {
    appearance:none; -webkit-appearance:none;
    background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
    border:1px solid #d1d5db; border-radius:8px;
    padding:9px 34px 9px 12px; font-size:.875rem; font-family:inherit;
    color:#1f2937; cursor:pointer; min-width:230px;
}
.jc-select:focus { outline:none; border-color:#1e3a8a; box-shadow:0 0 0 2px rgba(30,58,138,.12); }
.jc-select optgroup { font-size:.8125rem; font-weight:700; color:#6b7280; }
.jc-select option  { font-size:.875rem; font-weight:400; color:#1f2937; }

/* --- Section bouclement & outils --- */
.compta-tools-grid { display:grid; grid-template-columns:1fr 1fr; gap:24px; align-items:start; margin-top:32px; padding-top:28px; border-top:1px solid #e5e7eb; }
@media(max-width:768px){ .compta-tools-grid{grid-template-columns:1fr;} .jc-select{min-width:160px;} }
.tool-card { border:1px solid #e5e7eb; border-radius:8px; overflow:hidden; margin-bottom:16px; }
.tool-card-header { background:#f8fafc; border-bottom:1px solid #e5e7eb; padding:10px 16px; font-size:.8125rem; font-weight:700; color:#374151; text-transform:uppercase; letter-spacing:.04em; }
.tool-card-body { padding:16px; }
.journal-row { display:flex; align-items:center; justify-content:space-between; padding:10px 16px; border-bottom:1px solid #f3f4f6; font-size:.875rem; color:#374151; }
.journal-row:last-child { border-bottom:none; }
.journal-row:hover { background:#f9fafb; }
.btn-journal { color:#9ca3af; padding:5px 8px; border-radius:5px; text-decoration:none; font-size:.9rem; flex-shrink:0; transition:color .15s,background .15s; }
.btn-journal:hover { color:#3b82f6; background:#eff6ff; }
.section-title-custom { font-size:.9rem; font-weight:700; color:#1e293b; margin-bottom:12px; display:flex; align-items:center; gap:8px; }

/* ============================================================
   JOURNAUX COMPTABLES
   Extrait de journaux-comptables.php
   ============================================================ */

/* --- Selecteur journal --- */
.jc-tabs {
    display: flex; gap: 2px; flex-wrap: wrap;
    border-bottom: 2px solid #e5e7eb; margin-bottom: 24px;
}
.jc-tab {
    padding: 9px 18px; background: transparent;
    border: none; border-bottom: 3px solid transparent; margin-bottom: -2px;
    font-size: .875rem; font-weight: 500; color: #6b7280;
    cursor: pointer; font-family: inherit; border-radius: 0;
    transition: color .15s;
}
.jc-tab:hover { color: #111827; }
.jc-tab.active { color: #1e3a8a; border-bottom-color: #1e3a8a; font-weight: 700; }

/* --- Formulaire dates --- */
.jc-form-row {
    display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 28px;
}
.jc-form-row label { display: block; font-size: .8125rem; font-weight: 600; color: #374151; margin-bottom: 4px; }
.btn-jc-load {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 20px; background: #1e3a8a; color: #fff;
    border: none; border-radius: 8px; font-size: .875rem; font-weight: 600;
    cursor: pointer; font-family: inherit;
}
.btn-jc-load:hover { background: #1e40af; }
.btn-jc-pdf {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 18px; background: #fff; color: #374151;
    border: 1px solid #d1d5db; border-radius: 8px; font-size: .875rem;
    font-weight: 500; text-decoration: none; font-family: inherit;
}
.btn-jc-pdf:hover { background: #f9fafb; border-color: #9ca3af; }

/* --- Sections --- */
.jc-section { margin-bottom: 32px; }
.jc-section-header {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
    padding: 10px 14px; background: #f8fafc;
    border: 1px solid #e5e7eb; border-left: 4px solid #64748b;
    border-radius: 6px 6px 0 0; gap: 10px;
}
.jc-section-title { font-size: .9rem; font-weight: 700; color: #1e293b; }
.jc-section-meta { font-size: .8125rem; color: #6b7280; display: flex; gap: 16px; align-items: center; }
.jc-section-total { font-weight: 700; color: #1e293b; }

/* --- Tableau lignes --- */
.jc-table {
    font-size: .8125rem;
    border: 1px solid #e5e7eb; border-top: none;
}
.jc-table th {
    background: #f1f5f9; padding: 7px 10px; text-align: left;
    font-weight: 600; color: #475569; font-size: .75rem; text-transform: uppercase;
    letter-spacing: .04em; border-bottom: 1px solid #cbd5e1;
    position: sticky; top: 0; z-index: 1;
}
.jc-table td { padding: 5px 10px; border-bottom: 1px solid #f1f5f9; color: #374151; }
.jc-row-alt { background: #f8fafc; }
.jc-row-tva td { color: #94a3b8; font-size: .78rem; }
.jc-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.jc-table .cpt { font-family: monospace; font-size: .8rem; }

/* --- Recapitulatif par compte --- */
.jc-subtotals {
    border: 1px solid #e5e7eb; border-top: 2px solid #cbd5e1;
    border-radius: 0 0 6px 6px; overflow: hidden;
}
.jc-recap-table { font-size: .8125rem; }
.jc-recap-table th {
    background: #f8fafc; padding: 7px 10px; text-align: left;
    font-weight: 600; color: #64748b; font-size: .75rem; text-transform: uppercase;
    letter-spacing: .04em;
}
.jc-recap-table td { padding: 5px 10px; border-bottom: 1px solid #f1f5f9; color: #374151; }
.jc-total-row td {
    background: #f1f5f9; font-weight: 700; border-top: 1px solid #cbd5e1;
    color: #1e293b;
}
.jc-empty {
    padding: 20px; text-align: center; color: #9ca3af; font-size: .875rem;
    border: 1px solid #e5e7eb; border-top: none; border-radius: 0 0 6px 6px;
}
.jc-periode { font-size: .8125rem; color: #6b7280; margin-bottom: 20px; }
.jc-actions { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 20px; }

@media print {
    nav, .menu, .action-top, .submenu, .jc-form-row, .jc-tabs,
    .jc-actions, footer { display: none !important; }
    .main { margin: 0 !important; padding: 0 !important; }
    .page-card { box-shadow: none !important; border: none !important; padding: 4px !important; }
    .jc-section { break-inside: avoid; page-break-inside: avoid; }
    .jc-table th { position: static; }
}


/* ============================================================
   ETIQUETTES POSTE
   Extrait de etiquettes-poste.php
   ============================================================ */

/* Centrage etiquette */
.ep-center { max-width: 620px; margin: 0 auto; }

/* Boite etiquette */
.lbl-box {
    background: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,.10);
    padding: 16px 18px;
    font-family: Arial, Helvetica, sans-serif;
}

/* Zone editable : display + crayon */
.lbl-field-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.lbl-field-display { flex: 1; }
.lbl-pencil {
    color: #cbd5e1;
    font-size: .8rem;
    flex-shrink: 0;
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 4px;
    transition: color .15s, background .15s;
    text-decoration: none;
}
.lbl-pencil:hover { color: #3b82f6; background: #eff6ff; }
.lbl-pencil.active { color: #3b82f6; }

/* Inline edit zone */
.lbl-edit-zone {
    display: none;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.lbl-edit-zone.open { display: flex; }
.lbl-edit-input {
    border: 1px solid #3b82f6;
    border-radius: 5px;
    padding: 4px 8px;
    font-size: .88rem;
    font-family: Arial, Helvetica, sans-serif;
    outline: none;
    background: #fff;
}
.lbl-edit-input:focus { box-shadow: 0 0 0 2px rgba(59,130,246,.2); }
.lbl-edit-actions { display: flex; gap: 4px; }
.lbl-btn-ok {
    background: #22c55e; color: #fff; border: none;
    border-radius: 5px; padding: 4px 10px; cursor: pointer;
    font-size: .8rem; font-weight: 700;
}
.lbl-btn-cancel {
    background: #f1f5f9; color: #64748b; border: none;
    border-radius: 5px; padding: 4px 10px; cursor: pointer;
    font-size: .8rem;
}
.lbl-saving { font-size: .75rem; color: #3b82f6; }
.lbl-saved  { font-size: .75rem; color: #22c55e; }
.lbl-error  { font-size: .75rem; color: #ef4444; }

/* NPA + Ville */
.lbl-dest-txt {
    font-size: 1rem;
    font-weight: 700;
    color: #111;
    min-height: 20px;
}

/* Zone principale */
.lbl-main { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; }
.lbl-bc-col { flex: 1; min-width: 0; }

/* Image code barre statique */
.lbl-bc-static { display: block; width: 100%; max-width: 380px;
                 height: auto; border-radius: 2px; }
.lbl-bc-missing { width: 100%; max-width: 380px; height: 70px;
                   background: #f8fafc; border: 1px dashed #cbd5e1;
                   border-radius: 4px; display: flex; align-items: center;
                   justify-content: center; font-size: .75rem;
                   color: #94a3b8; }

/* Texte code */
.lbl-code-txt {
    font-size: .88rem;
    font-weight: 700;
    color: #111;
    letter-spacing: .04em;
    font-family: 'Courier New', monospace;
}
.lbl-code-auto { color: #3b82f6; }

/* Colonne droite */
.lbl-right { flex: 0 0 auto; display: flex; flex-direction: column;
             align-items: center; gap: 4px; }

/* Separateur */
.lbl-sep { border: none; border-top: 1px solid #e2e8f0; margin: 12px 0; }

/* Bas */
.lbl-bottom { display: flex; gap: 16px; align-items: flex-start; }
.lbl-sender { flex: 0 0 155px; font-size: .72rem; color: #444; line-height: 1.6; }
.lbl-recip  { flex: 1; font-size: .95rem; font-weight: 500; color: #111; line-height: 1.6; }

/* Toast inline */
#ep-toast {
    position: fixed; bottom: 24px; right: 24px;
    padding: 10px 18px; border-radius: 8px;
    font-size: .85rem; font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    display: none; z-index: 9999;
}
#ep-toast.ok  { background: #dcfce7; color: #15803d; }
#ep-toast.err { background: #fee2e2; color: #dc2626; }


/* ============================================================
   CALCUL PRIX DE VENTE
   Extrait de calculation-prix-vente.php
   ============================================================ */

.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 24px;
}
@media (max-width: 860px) {
    .calc-grid { grid-template-columns: 1fr; }
}
.calc-panel {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
}
.calc-panel h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 18px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
}
.calc-steps {
    width: 100%;
    border-collapse: collapse;
}
.calc-steps tr { border-bottom: 1px solid #f0f0f0; }
.calc-steps tr:last-child { border-bottom: none; }
.calc-steps td {
    padding: 9px 6px;
    font-size: 0.875rem;
    color: #374151;
}
.calc-steps td:last-child {
    text-align: right;
    font-weight: 500;
    color: #1e40af;
    white-space: nowrap;
}
.calc-steps tr.step-sub td:first-child {
    padding-left: 20px;
    color: #6b7280;
    font-size: 0.82rem;
}
.calc-steps tr.step-sub td:last-child {
    color: #6b7280;
    font-weight: 400;
}
.calc-steps tr.step-result td {
    font-weight: 700;
    font-size: 0.95rem;
    color: #111827;
    padding-top: 12px;
}
.calc-steps tr.step-result td:last-child {
    color: #059669;
    font-size: 1.1rem;
}
.calc-steps tr.step-divider td {
    padding: 2px 0;
    border-top: 2px solid #e5e7eb;
}
.prix-achat-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.prix-achat-input input {
    width: 120px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    text-align: right;
    color: #1e40af;
}
.prix-achat-input label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}
.currency-badge {
    background: #dbeafe;
    color: #1e40af;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.8rem;
    font-weight: 600;
}


/* ============================================================
   INFO ENTREPRISE
   Extrait de info-entreprise.php
   ============================================================ */

.section-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
}
.section-card h2 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
}
@media (max-width: 700px) {
    .form-grid { grid-template-columns: 1fr; }
}
.radio-group {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
}
.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    margin: 0;
}
.radio-group input[type="radio"] {
    width: auto;
    margin: 0;
    accent-color: #3b82f6;
}
.iban-hint {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 4px;
}


/* ============================================================
   MISE EN PAGE - CONCERNE
   Extrait de mise-en-page-concerne.php
   ============================================================ */

.concerne-grid {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}
.concerne-col {
    flex: 1;
    min-width: 0;
}
.concerne-col label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .8rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.concerne-col .flag-icon {
    font-size: .75rem;
    background: #e2e8f0;
    border-radius: 3px;
    padding: 1px 5px;
    color: #334155;
    font-style: normal;
    font-weight: 700;
}
.concerne-col textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    font-family: 'Inter', monospace;
    font-size: .82rem;
    line-height: 1.6;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 8px 10px;
    background: #f8fafc;
    color: #1e293b;
    transition: border-color .2s, box-shadow .2s;
    min-height: 90px;
}
.concerne-col textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
    background: #fff;
}


/* ============================================================
   MISE EN PAGE - HAUT
   Extrait de mise-en-page-haut.php
   ============================================================ */

.type-tabs { display:flex; gap:10px; margin-top:14px; margin-bottom:28px; flex-wrap:wrap; }
.type-tab  { flex:1; min-width:140px; border:2px solid #e5e7eb; border-radius:10px; padding:16px 12px; text-align:center; cursor:pointer; background:#fff; transition:.2s; font-size:.875rem; font-weight:600; color:#6b7280; }
.type-tab:hover { border-color:#93c5fd; color:#3b82f6; }
.type-tab.active { border-color:#3b82f6; color:#3b82f6; background:#eff6ff; }
.type-tab i { display:block; font-size:1.5rem; margin-bottom:6px; }
.affichage-row { display:flex; gap:20px; flex-wrap:wrap; align-items:center; margin-bottom:14px; }
.affichage-row label { display:flex; align-items:center; gap:6px; font-size:.875rem; font-weight:500; cursor:pointer; }


/* ============================================================
   MENU - BANDEAU IMPERSONATION
   Extrait de includes/menu.php
   ============================================================ */

/* Decale le sous-menu et le contenu pour laisser la place au bandeau d'impersonation */
/* Applique uniquement quand body.impersonating est present */
body.impersonating .secondary-menu         { margin-top: 97px !important; }
body.impersonating .secondary-menu--sub    { margin-top: 0 !important; }
body.impersonating main.main.no-submenu    { margin-top: 97px !important; }
body.impersonating .app-main               { padding-top: 140px !important; }
body.impersonating .gu-wrap,
body.impersonating .admin-wrap             { margin-top: 37px; }

/* Sous-menu sub toujours colle au menu principal */
.secondary-menu--sub { margin-top: 0 !important; }


/* ==========================================================================
   GRADIENT COMPONENTS (bleu → violet → rose)
   ========================================================================== */

/* -- Gradient text -------------------------------------------------------- */
.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* -- Gradient line / separator -------------------------------------------- */
.gradient-line {
    height: 3px;
    border-radius: 3px;
    background: var(--gradient-text);
}

/* -- Gradient icon (fond subtle + icone gradient) ------------------------- */
.gradient-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--gradient-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
}
.gradient-icon i {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.1rem;
}

/* -- Gradient button (CTA principal) -------------------------------------- */
.btn-gradient {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: linear-gradient(135deg, #003399 0%, #7c3aed 60%, #ec4899 100%);
    color: #fff;
    font-weight: 600;
    font-size: .875rem;
    font-family: inherit;
    transition: all .2s ease;
    box-shadow: 0 2px 12px rgba(124, 58, 237, .25);
    text-decoration: none;
}
.btn-gradient:hover {
    box-shadow: 0 4px 20px rgba(124, 58, 237, .35);
    transform: translateY(-1px);
}

/* -- Gradient outline button ---------------------------------------------- */
.btn-gradient-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
    position: relative;
    color: #7c3aed;
    font-weight: 600;
    font-size: .875rem;
    font-family: inherit;
    transition: all .2s ease;
    text-decoration: none;
}
.btn-gradient-outline::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    padding: 1.5px;
    background: var(--gradient-border);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}
.btn-gradient-outline:hover {
    box-shadow: var(--gradient-glow);
}

/* -- Gradient border card ------------------------------------------------- */
.gradient-card {
    position: relative;
    border-radius: 14px;
    padding: 1px;
    background: var(--gradient-border);
}
.gradient-card-inner {
    background: #fff;
    border-radius: 13px;
    padding: 24px;
}

/* -- Gradient badge ------------------------------------------------------- */
.badge-gradient {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    background: var(--gradient-subtle);
}
.badge-gradient span {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* -- Gradient tag --------------------------------------------------------- */
.grad-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(0,51,153,.05), rgba(124,58,237,.08), rgba(236,72,153,.05));
    border: 1px solid rgba(124, 58, 237, .12);
    font-size: .82rem;
    font-weight: 500;
    color: #5b21b6;
}

/* -- KPI card with gradient accent ---------------------------------------- */
.kpi-card-grad {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: all .2s ease;
}
.kpi-card-grad::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-text);
}
.kpi-card-grad:hover {
    box-shadow: var(--gradient-glow);
    border-color: rgba(124, 58, 237, .2);
}

/* -- Section title with gradient bar -------------------------------------- */
.section-title-grad {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}
.section-title-grad i {
    color: var(--primary-dark);
}
.section-title-grad::before {
    content: '';
    width: 4px;
    height: 24px;
    border-radius: 4px;
    background: var(--gradient-text);
    flex-shrink: 0;
}

/* -- Gradient tabs -------------------------------------------------------- */
.grad-tabs {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
}
.grad-tab {
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: .82rem;
    font-weight: 500;
    font-family: inherit;
    background: transparent;
    color: var(--text-gray);
    transition: all .15s ease;
}
.grad-tab.active {
    background: #fff;
    color: #7c3aed;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}
.grad-tab:hover:not(.active) {
    color: var(--text-dark);
}

/* -- Gradient progress bar ------------------------------------------------ */
.grad-progress {
    height: 6px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}
.grad-progress-bar {
    height: 100%;
    border-radius: 6px;
    background: var(--gradient-text);
}

/* -- Gradient notification dot -------------------------------------------- */
.notif-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gradient-text);
    box-shadow: 0 0 8px rgba(124, 58, 237, .4);
}

/* -- Gradient avatar ring ------------------------------------------------- */
.avatar-gradient {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    padding: 2px;
    background: var(--gradient-border);
}
.avatar-gradient-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    color: #64748b;
}

/* ============================================================
   MODAL RÉCURRENCE — contenu spécifique
   (overlay / box / head / close → fe-modal-* standard)
   ============================================================ */
.rec-modal-body {
    padding: 20px 20px 16px;
    overflow-y: auto;
    max-height: 75vh;
}
.rec-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.rec-label {
    font-size: .82rem;
    font-weight: 600;
    color: #475569;
    min-width: 110px;
}
.rec-select, .rec-input {
    flex: 1;
    min-width: 80px;
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-size: .88rem;
    font-family: inherit;
    color: #1e293b;
    background: #f8fafc;
    transition: border-color .15s;
}
.rec-select:focus, .rec-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
}
.rec-input-num {
    width: 64px;
    flex: none;
    text-align: center;
}
/* Boutons jours de semaine */
.rec-days-wrap {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.rec-day-btn {
    width: 32px;
    height: 32px;
    border: 1.5px solid #cbd5e1;
    border-radius: 50%;
    background: #f8fafc;
    color: #475569;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rec-day-btn.active {
    background: linear-gradient(135deg,#003399,#7c3aed);
    border-color: #003399;
    color: #fff;
}
.rec-day-btn:hover:not(.active) {
    border-color: #003399;
    color: #003399;
    background: #eef2ff;
}
/* Badge récurrence sur le bouton de la topbar */
.fe-btn-rec-active {
    background: linear-gradient(135deg,#003399,#7c3aed,#ec4899) !important;
    color: #fff !important;
    border-color: transparent !important;
}
/* Pied du modal récurrence (utilise fe-modal-foot-split) */
.rec-btn-del {
    padding: 8px 16px;
    border: 1px solid #fca5a5;
    border-radius: 7px;
    background: #fff;
    color: #dc2626;
    font-size: .83rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}
.rec-btn-del:hover { background: #fee2e2; }
.rec-btn-save {
    padding: 8px 22px;
    border: none;
    border-radius: 7px;
    background: linear-gradient(135deg,#003399,#7c3aed,#ec4899);
    color: #fff;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: opacity .15s;
}
.rec-btn-save:hover { opacity: .88; }
.rec-section-sep {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 12px 0;
}
