/* ═══════════════════════════════════════════════════════════════════════════
   TELEPHONIC PRO — UNIFIED DASHBOARD DESIGN SYSTEM
   Shared CSS for Admin, Superviseur, Grossiste & Boutique dashboards
   ═══════════════════════════════════════════════════════════════════════════ */


/* ─────────────────────────────────────────────────────────────────────────
   1. ENTRY ANIMATIONS
   ────────────────────────────────────────────────────────────────────────── */

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

@keyframes countUp {
    from { opacity: 0; transform: scale(0.5); }
    to   { opacity: 1; transform: scale(1); }
}

/* Removed glowing / neon / shimmer animations for professional SaaS look */

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.anim-in  { animation: fadeSlideUp 0.45s cubic-bezier(.21,1.02,.73,1) both; }
.anim-d1  { animation-delay: 0.04s; }
.anim-d2  { animation-delay: 0.08s; }
.anim-d3  { animation-delay: 0.12s; }
.anim-d4  { animation-delay: 0.16s; }
.anim-d5  { animation-delay: 0.20s; }
.anim-d6  { animation-delay: 0.24s; }
.anim-d7  { animation-delay: 0.28s; }
.anim-d8  { animation-delay: 0.32s; }

.animate-fade-in { animation: fadeIn 0.3s ease both; }


/* ─────────────────────────────────────────────────────────────────────────
   2. TOUCH UX (Mobile PWA Native Feel)
   ────────────────────────────────────────────────────────────────────────── */

.tap {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}
.tap:active {
    transform: scale(0.96) !important;
    transition: transform 80ms !important;
}


/* ─────────────────────────────────────────────────────────────────────────
   3. KPI RIBBON — Horizontal scroll (mobile) → Grid (desktop)
   ────────────────────────────────────────────────────────────────────────── */

.kpi-ribbon {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 16px 8px;
    margin: 0 -16px;
}
.kpi-ribbon::-webkit-scrollbar { display: none; }
.kpi-ribbon > * {
    scroll-snap-align: start;
    flex: 0 0 auto;
    width: 72vw;
    max-width: 280px;
}
@media (min-width: 640px) {
    .kpi-ribbon > * { width: auto; max-width: none; }
}
@media (min-width: 768px) {
    .kpi-ribbon {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        overflow: visible;
        padding: 0;
        margin: 0;
        gap: 16px;
    }
}
@media (min-width: 1024px) {
    .kpi-ribbon { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}
/* 4-col variant */
.kpi-ribbon-4 { composes: kpi-ribbon; }
@media (min-width: 1024px) {
    .kpi-ribbon-4 { grid-template-columns: repeat(4, 1fr); }
}


/* ─────────────────────────────────────────────────────────────────────────
   4. QUICK ACTIONS GRID — Mobile-only App-style icon dock
   ────────────────────────────────────────────────────────────────────────── */

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
@media (min-width: 640px) {
    .quick-actions-grid { display: none; }
}

.qa-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.2s;
    text-decoration: none;
}
.qa-item:active {
    background: rgba(255,255,255,0.08);
    transform: scale(0.94);
}
.qa-icon {
    width: 40px; height: 40px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.qa-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    text-align: center;
    line-height: 1.2;
}

/* 5-col variant for boutique */
.quick-actions-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
@media (min-width: 640px) {
    .quick-actions-grid-5 { display: none; }
}


/* ─────────────────────────────────────────────────────────────────────────
   5. HERO SECTION — Shared dashboard header patterns
   ────────────────────────────────────────────────────────────────────────── */

.dash-hero {
    position: relative;
    overflow: hidden;
    background: #18181b; /* zinc-900 */
    border-radius: 1.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #27272a; /* zinc-800 */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
@media (min-width: 640px) {
    .dash-hero {
        border-radius: 2rem;
        padding: 1.75rem;
        margin-bottom: 2rem;
    }
}
@media (min-width: 768px) {
    .dash-hero {
        padding: 2.5rem;
    }
}

/* Removed heavy blur orbs from background for a clean Pro layout */
.dash-hero-blur {
    display: none;
}

/* Desktop action buttons — hidden on mobile (use quick-actions) */
.hero-btns { display: none; }
@media (min-width: 640px) { .hero-btns { display: flex; } }


/* ─────────────────────────────────────────────────────────────────────────
   6. ORDER ROW — Compact native-feel list items
   ────────────────────────────────────────────────────────────────────────── */

.order-row-m {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.15s;
    position: relative;
}
.order-row-m:active {
    background: rgba(255,255,255,0.07);
    transform: scale(0.98);
}
.order-avatar {
    width: 38px; height: 38px;
    border-radius: 12px;
    background: rgba(30,30,40,0.8);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.order-info  { flex: 1; min-width: 0; }
.order-name  { font-size: 12px; font-weight: 800; color: #f0f2f8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-meta  { font-size: 9px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }
.order-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.order-price { font-size: 13px; font-weight: 900; color: #f0f2f8; letter-spacing: -0.03em; }

.order-badge {
    font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
    padding: 2px 7px; border-radius: 6px; border: 1px solid;
}
.badge-pending   { color: #f59e0b; background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.2); }
.badge-delivered { color: #10b981; background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.2); }
.badge-transit   { color: #a855f7; background: rgba(168,85,247,0.1); border-color: rgba(168,85,247,0.2); }
.badge-other     { color: #3b82f6; background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.2); }
.badge-danger    { color: #ef4444; background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.2); }

/* Desktop size-up */
@media (min-width: 640px) {
    .order-row-m  { padding: 14px 16px; border-radius: 18px; gap: 14px; }
    .order-avatar { width: 44px; height: 44px; border-radius: 14px; font-size: 18px; }
    .order-name   { font-size: 13px; }
    .order-meta   { font-size: 10px; }
    .order-price  { font-size: 15px; }
    .order-badge  { font-size: 9px; padding: 3px 8px; }
}


/* ─────────────────────────────────────────────────────────────────────────
   7. SECTION TITLES — Mobile-first uppercase label
   ────────────────────────────────────────────────────────────────────────── */

.mob-section-title {
    font-size: 10px;
    font-weight: 900;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 0 2px;
    margin-bottom: 10px;
}
@media (min-width: 640px) {
    .mob-section-title { font-size: 11px; margin-bottom: 14px; }
}


/* ─────────────────────────────────────────────────────────────────────────
   8. DASHBOARD CARDS — Shared card patterns
   ────────────────────────────────────────────────────────────────────────── */

.dash-card {
    background: #18181b; /* zinc-900 */
    border: 1px solid #27272a; /* zinc-800 */
    border-radius: 1rem;
    padding: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.2s ease-in-out;
}
@media (min-width: 640px) {
    .dash-card {
        border-radius: 2rem;
        padding: 1.75rem;
        box-shadow: 0 4px 30px rgba(0,0,0,0.15);
    }
}
.dash-card:hover {
    border-color: rgba(255,255,255,0.1);
}

/* Dash Card Glow Removed for Professional Matte Look */
.dash-card-glow {
    display: none;
}


/* ─────────────────────────────────────────────────────────────────────────
   9. PIPELINE TABS — Segmented control for order states
   ────────────────────────────────────────────────────────────────────────── */

.pipe-tab.active .tab-indicator {
    opacity: 1;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255,255,255,0.05);
}
.pipe-tab.active span.text-slate-400 { color: white; }


/* ─────────────────────────────────────────────────────────────────────────
   10. UTILITY CLASSES
   ────────────────────────────────────────────────────────────────────────── */

/* No-scrollbar (hide but keep scrolling) */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* KPI Card (shared pattern for stat blocks) */
.kpi-card {
    background: #18181b; /* zinc-900 */
    border: 1px solid #27272a; /* zinc-800 */
    padding: 1rem;
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}
@media (min-width: 640px) {
    .kpi-card { padding: 1.5rem; border-radius: 1rem; }
}
.kpi-card:hover {
    transform: translateY(-2px);
}

.kpi-label {
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
}
@media (min-width: 640px) {
    .kpi-label { font-size: 10px; letter-spacing: 0.2em; }
}

.kpi-value {
    font-size: 1.25rem;
    font-weight: 900;
    color: #f8fafc;
    letter-spacing: -0.03em;
}
@media (min-width: 640px) {
    .kpi-value { font-size: 1.875rem; }
}

.kpi-icon {
    width: 1.75rem; height: 1.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}
@media (min-width: 640px) {
    .kpi-icon { width: 2.25rem; height: 2.25rem; border-radius: 0.75rem; font-size: 1.125rem; }
}

.kpi-sub {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 2px;
}
@media (min-width: 640px) {
    .kpi-sub { font-size: 9px; }
}


/* ─────────────────────────────────────────────────────────────────────────
   11. LIVREUR / WALLET CARD — Mobile-friendly wallet items
   ────────────────────────────────────────────────────────────────────────── */

.wallet-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.2s;
}
@media (min-width: 640px) {
    .wallet-card { padding: 16px; border-radius: 20px; gap: 16px; }
}
.wallet-card:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}


/* ─────────────────────────────────────────────────────────────────────────
   12. CHART CONTAINER — Responsive canvas wrapper
   ────────────────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .chart-container canvas {
        max-height: 180px !important;
    }
}
