﻿/* ========================================
   ANIMO RETAIL - dashboard
   Brand aligned 
======================================== */

:root {
    --bg-page: #F9FAFB;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F5F3FF;
    --accent-primary: #4F46E5;
    --accent-primary-dark: #4338CA;
    --accent-primary-light: #6366F1;
    --accent-success: #22C55E;
    --accent-warning: #F59E0B;
    --accent-error: #EF4444;
    --text-heading: #111827;
    --text-body: #374151;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 16px rgba(79,70,229,0.08), 0 2px 8px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(79,70,229,0.12), 0 4px 12px rgba(0,0,0,0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'DM Mono', monospace;
}

.pos-dashboard {
    font-family: var(--font);
    background: var(--bg-page);
    min-height: 100vh;
    padding: 0;
}

/* ── HEADER ── */
.dash-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 18px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.92);
    box-shadow: var(--shadow-sm);
}

.dash-header-left h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
    letter-spacing: -0.4px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-header-left p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 2px 0 0 0;
    font-weight: 400;
}

.badge-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ECFDF5;
    color: #065F46;
    border-radius: 20px;
    padding: 3px 12px 3px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

    .badge-live::before {
        content: '';
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--accent-success);
        animation: pulse-dot 1.6s ease-in-out infinite;
    }

@@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.7);
    }
}

.btn-refresh {
    background: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 22px;
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}

    .btn-refresh:hover {
        background: var(--accent-primary-dark);
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(79,70,229,0.35);
    }

    .btn-refresh:active {
        transform: translateY(0);
    }

    .btn-refresh svg {
        width: 16px;
        height: 16px;
    }

/* ── BODY ── */
.dash-body {
    padding: 28px 32px 0;
}

/* ── SECTION LABEL ── */
.section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .section-label::after {
        content: '';
        flex: 1;
        height: 1.5px;
        background: linear-gradient(to right, var(--border), transparent);
    }

/* ── KPI GRID ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: default;
    position: relative;
    overflow: hidden;
}

    .kpi-card::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: var(--accent-primary);
        opacity: 0;
        transition: opacity 0.25s;
    }

    .kpi-card:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-3px);
        border-color: var(--accent-primary-light);
    }

        .kpi-card:hover::after {
            opacity: 1;
        }

.kpi-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    font-size: 16px;
    background: #F3F4F6; /* fallback */
}

.kpi-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
    letter-spacing: 0.2px;
}

.kpi-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
    font-family: var(--font-mono);
    line-height: 1.2;
}

    .kpi-value.positive {
        color: var(--accent-success);
    }

    .kpi-value.negative {
        color: var(--accent-error);
    }

/* ── MATRIX TABLE ── */
.matrix-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 32px;
    transition: box-shadow 0.2s;
}

    .matrix-card:hover {
        box-shadow: var(--shadow-md);
    }

.matrix-card-header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .matrix-card-header h6 {
        font-size: 0.9rem;
        font-weight: 700;
        color: var(--text-heading);
        margin: 0;
    }

.table-pos {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

    .table-pos thead th {
        background: #F9FAFB;
        padding: 12px 20px;
        text-align: left;
        font-size: 0.7rem;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border-bottom: 1px solid var(--border);
        white-space: nowrap;
    }

    .table-pos tbody tr {
        border-bottom: 1px solid var(--border);
        transition: background 0.15s;
    }

        .table-pos tbody tr:last-child {
            border-bottom: none;
        }

        .table-pos tbody tr:hover {
            background: #F5F3FF; /* primary tint */
        }

    .table-pos tbody td {
        padding: 12px 20px;
        color: var(--text-body);
        font-weight: 400;
    }

        .table-pos tbody td:first-child {
            font-weight: 600;
            color: var(--text-heading);
        }

        .table-pos tbody td.number {
            font-family: var(--font-mono);
            font-size: 0.78rem;
            color: var(--text-heading);
        }

/* ── CHART CARDS ── */
.chart-row {
    display: grid;
    gap: 20px;
    margin-bottom: 32px;
}

    .chart-row.cols-1-2 {
        grid-template-columns: 1fr 2fr;
    }

    .chart-row.cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.2s ease;
}

    .chart-card:hover {
        box-shadow: var(--shadow-md);
        border-color: var(--accent-primary-light);
    }

.chart-card-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border);
}

    .chart-card-header h6 {
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--text-heading);
        margin: 0;
    }

    .chart-card-header p {
        font-size: 0.7rem;
        color: var(--text-muted);
        margin: 2px 0 0 0;
    }

.chart-card-body {
    padding: 8px 12px 12px;
    min-height: 260px;
}

/* ── SKELETON ── */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}

.skeleton {
    background: linear-gradient(90deg, #f0f2f5 25%, #e4e7ec 50%, #f0f2f5 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

.skeleton-kpi {
    height: 80px;
}

.skeleton-table {
    height: 200px;
    border-radius: var(--radius);
    margin-bottom: 32px;
}

.skeleton-chart {
    height: 280px;
}

@@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ── RESPONSIVE ── */
@@media (max-width: 900px) {
    .dash-body {
        padding: 16px;
    }

    .chart-row.cols-1-2,
    .chart-row.cols-3 {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

@@media (max-width: 540px) {
    .dash-header {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}