/* ==========================================================================
   TABLEAU DE BORD PROFESSIONNEL - TESLA DELIVERY ADVISOR (DA)
   ========================================================================== */

.dashboard-container {
    padding: 0;
    max-width: 1480px;
    margin: 0 auto 40px auto;
    font-size: 0.95rem;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --------------------------------------------------------------------------
   HEADER & ACTIONS STRATÉGIQUES
   -------------------------------------------------------------------------- */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-solid);
}

.dash-title-group h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--tesla-black);
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-title-group p {
    margin: 4px 0 0 0;
    color: var(--text-grey);
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hub-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hub-live-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.dash-actions-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-action-da {
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn-action-da:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-action-da:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-affectation {
    background: var(--tesla-black);
    color: white;
}
.btn-affectation:hover {
    background: #000000;
}

.btn-livraison-auto {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-planning-link {
    background: white;
    color: var(--tesla-black);
    border: 1px solid var(--border-solid);
}
.btn-planning-link:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* --------------------------------------------------------------------------
   HERO KPI CARDS
   -------------------------------------------------------------------------- */
.kpi-hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.kpi-hero-card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-glass);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.kpi-hero-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

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

.kpi-hero-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-grey);
    margin: 0;
}

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

.kpi-hero-val {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--tesla-black);
    line-height: 1.1;
    margin: 0 0 6px 0;
    font-family: 'Outfit', sans-serif;
}

.kpi-hero-sub {
    font-size: 0.82rem;
    color: var(--text-grey);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kpi-progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 10px;
}

.kpi-progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 1s ease-in-out;
}

/* --------------------------------------------------------------------------
   GRAPHIQUES STRATÉGIQUES (CHART.JS)
   -------------------------------------------------------------------------- */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
    gap: 22px;
    margin-bottom: 30px;
}

.chart-card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-glass);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.chart-card:hover {
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.07);
}

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

.chart-title-area h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-title-area p {
    margin: 3px 0 0 0;
    font-size: 0.82rem;
    color: var(--text-grey);
}

.chart-chip {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: #f1f5f9;
    color: #475569;
}

.chart-container-box {
    position: relative;
    width: 100%;
    height: 270px;
}

/* --------------------------------------------------------------------------
   SECTIONS INFÉRIEURES (AGENDA, SPEC DU HUB, LIVE FEED)
   -------------------------------------------------------------------------- */
.bottom-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 22px;
}

@media (max-width: 1080px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .bottom-grid {
        grid-template-columns: 1fr;
    }
}

.dash-panel {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-glass);
    transition: var(--transition);
}

.dash-panel-title {
    margin: 0 0 16px 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-solid);
}

/* Cartes Prochaines Livraisons */
.livraisons-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.livraison-item-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-solid);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.livraison-item-card:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.liv-client-name {
    font-weight: 700;
    color: var(--tesla-black);
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.liv-meta {
    font-size: 0.82rem;
    color: var(--text-grey);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.liv-vin-chip {
    font-family: monospace;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #334155;
    font-size: 0.75rem;
}

.liv-date-badge {
    text-align: right;
}

.liv-date-val {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.92rem;
}

.liv-statut-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 4px;
}

/* Feed CRM Live */
.feed-stream {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 480px;
    overflow-y: auto;
}

.feed-event-card {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.65);
    border-left: 4px solid var(--tesla-black);
    font-size: 0.88rem;
    transition: var(--transition);
}

.feed-event-card:hover {
    background: #ffffff;
    transform: translateX(3px);
}

.feed-evt-time {
    font-size: 0.75rem;
    color: var(--text-grey);
    font-weight: 600;
}

/* Hub Specs Cards */
.hub-specs-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.hub-spec-box {
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid var(--border-solid);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
}

.hub-spec-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--tesla-black);
    font-family: 'Outfit', sans-serif;
}

.hub-spec-lbl {
    font-size: 0.72rem;
    color: var(--text-grey);
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 3px;
}
