/**
 * Budget Planner For Dolibarr — CSS Module
 * ETS BRIDGE Solutions — MVP 1.0
 */

/* ─── Badges de statut et priorité ─────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.78em;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-secondary  { background: #6c757d; color: #fff; }
.badge-info       { background: #17a2b8; color: #fff; }
.badge-success    { background: #28a745; color: #fff; }
.badge-danger     { background: #dc3545; color: #fff; }
.badge-warning    { background: #ffc107; color: #333; }
.badge-primary    { background: #007bff; color: #fff; }
.badge-dark       { background: #343a40; color: #fff; }

/* ─── Cartes KPI dashboard ──────────────────────────────────────────────── */
.bp-kpi-card {
    background: linear-gradient(135deg, var(--kpi-color, #4a6cf7) 0%, color-mix(in srgb, var(--kpi-color, #4a6cf7) 80%, #000) 100%);
    color: #fff;
    padding: 18px 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    min-width: 130px;
}

.bp-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

.bp-kpi-card .bp-kpi-icon  { font-size: 2em; line-height: 1; }
.bp-kpi-card .bp-kpi-value { font-size: 1.5em; font-weight: 700; margin: 4px 0; }
.bp-kpi-card .bp-kpi-label { font-size: 0.8em; opacity: 0.88; }

/* ─── Barre de progression budget ──────────────────────────────────────── */
.bp-progress-bar {
    background: #e9ecef;
    border-radius: 6px;
    height: 18px;
    overflow: hidden;
}

.bp-progress-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75em;
    font-weight: 600;
    color: #fff;
    min-width: 2em;
}

.bp-progress-fill.bp-ok      { background: #28a745; }
.bp-progress-fill.bp-warn    { background: #ffc107; color: #333; }
.bp-progress-fill.bp-danger  { background: #dc3545; }

/* ─── Score d'urgence ───────────────────────────────────────────────────── */
.bp-urgency-low    { color: #28a745; font-weight: 600; }
.bp-urgency-medium { color: #fd7e14; font-weight: 600; }
.bp-urgency-high   { color: #dc3545; font-weight: 700; }

/* ─── Tags ──────────────────────────────────────────────────────────────── */
.bp-tag {
    display: inline-block;
    padding: 2px 7px;
    background: #e9ecef;
    color: #495057;
    border-radius: 12px;
    font-size: 0.75em;
    margin: 1px;
    border: 1px solid #dee2e6;
}

/* ─── Alertes dashboard ─────────────────────────────────────────────────── */
.bp-alert {
    padding: 10px 16px;
    border-left: 4px solid;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 0.92em;
}

.bp-alert-warning { border-color: #ffc107; background: #fff9e6; color: #856404; }
.bp-alert-info    { border-color: #17a2b8; background: #e8f7f9; color: #0c5460; }
.bp-alert-danger  { border-color: #dc3545; background: #fce8ea; color: #721c24; }

/* ─── Formulaires modaux inline ─────────────────────────────────────────── */
.bp-inline-form {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 12px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.bp-inline-form h3 {
    margin-top: 0;
    font-size: 1.05em;
    color: #343a40;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
    margin-bottom: 14px;
}

/* ─── Répartition catégories dashboard ─────────────────────────────────── */
.bp-category-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bp-category-bar-track {
    flex: 1;
    background: #e9ecef;
    border-radius: 3px;
    height: 12px;
    overflow: hidden;
}

.bp-category-bar-fill {
    height: 100%;
    background: #4a6cf7;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.bp-category-bar-pct {
    min-width: 40px;
    text-align: right;
    font-size: 0.8em;
    color: #6c757d;
}

/* ─── Overdue dates ─────────────────────────────────────────────────────── */
.bp-overdue {
    color: #dc3545 !important;
    font-weight: 600;
}

/* ─── Status timeline (onglet historique) ──────────────────────────────── */
.bp-timeline {
    position: relative;
    padding-left: 28px;
}

.bp-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.bp-timeline-item {
    position: relative;
    margin-bottom: 16px;
}

.bp-timeline-item::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4a6cf7;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #4a6cf7;
}

.bp-timeline-date {
    font-size: 0.78em;
    color: #6c757d;
    margin-bottom: 2px;
}

.bp-timeline-content {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.9em;
}
