/* ============================================================
   SwiftPOS — Dashboard & Analytics Pages
   SaaS Modern Design Language
   ============================================================ */

/* ── Hero welcome banner ──────────────────────────────────── */
.hero-banner {
    border-radius: var(--sp-radius, 16px);
    background: linear-gradient(135deg,
        var(--sp-color-primary, #6d28d9) 0%,
        var(--sp-color-primary-dark, #5b21b6) 40%,
        var(--sp-color-info, #3b82f6) 100%);
    color: #fff;
    padding: 1.25rem 1.6rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 28px rgba(109, 40, 217, 0.28);
    margin-bottom: 1.5rem;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -45%; right: -8%;
    width: 300px; height: 300px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    pointer-events: none;
}

.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -65%; left: 28%;
    width: 220px; height: 220px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    pointer-events: none;
}

.hero-greeting {
    font-size: 0.78rem;
    opacity: 0.82;
    margin-bottom: 0.15rem;
}

.hero-name {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.2;
    font-family: 'Outfit', 'Poppins', system-ui, sans-serif;
    letter-spacing: -0.02em;
}

.hero-role {
    font-size: 0.78rem;
    opacity: 0.7;
    margin-top: 0.15rem;
}

.hero-date {
    font-size: 0.74rem;
    opacity: 0.65;
}

.hero-btn {
    border: 1.5px solid rgba(255, 255, 255, 0.38);
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    border-radius: var(--sp-radius-sm, 8px);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.48rem 1.05rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.18s ease;
}

.hero-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.hero-btn-primary {
    background: #fff;
    color: var(--sp-color-primary, #6d28d9) !important;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.hero-btn-primary:hover {
    background: rgba(255, 255, 255, 0.92);
}

/* ── KPI cards ────────────────────────────────────────────── */
.kpi-card {
    border-radius: var(--sp-radius, 16px);
    border: 1px solid var(--sp-color-border, #e5e7eb) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
    transition: box-shadow 0.22s ease, transform 0.22s ease;
    overflow: hidden;
    background: #fff;
}

.kpi-card:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px);
}

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

/* Icon color variants using new tokens */
.kpi-icon-purple {
    background: var(--sp-color-bg-tint, #f5f3ff);
    color: var(--sp-color-primary, #6d28d9);
}

.kpi-icon-green {
    background: var(--sp-color-bg-teal-tint, #f0fdfa);
    color: var(--sp-color-accent, #10b981);
}

.kpi-icon-blue {
    background: #eff6ff;
    color: var(--sp-color-info, #3b82f6);
}

.kpi-icon-amber {
    background: #fffbeb;
    color: var(--sp-color-warning, #f59e0b);
}

.kpi-icon-red {
    background: #fef2f2;
    color: var(--sp-color-danger, #ef4444);
}

.kpi-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--sp-color-text-muted, #9ca3af);
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-size: clamp(1rem, 4vw, 1.72rem);
    font-weight: 800;
    color: var(--sp-color-text-main, #111827);
    line-height: 1.1;
    word-break: break-all;
    font-family: 'Outfit', 'Poppins', system-ui, sans-serif;
}

.kpi-sub {
    font-size: 0.72rem;
    color: var(--sp-color-text-muted, #9ca3af);
    margin-top: 0.2rem;
}

.kpi-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2em 0.6em;
    border-radius: var(--sp-radius-pill, 500px);
    white-space: nowrap;
}

.kpi-badge-up {
    background: #f0fdf4;
    color: #16a34a;
}

.kpi-badge-down {
    background: #fef2f2;
    color: #dc2626;
}

/* ── Chart cards ──────────────────────────────────────────── */
.chart-card {
    border-radius: var(--sp-radius, 16px);
    border: 1px solid var(--sp-color-border, #e5e7eb) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
    background: #fff;
}

.chart-card .card-header {
    border-bottom: 1px solid var(--sp-color-bg-light, #f3f4f6);
    border-radius: var(--sp-radius, 16px) var(--sp-radius, 16px) 0 0;
    background: #fff;
    padding: 0.92rem 1.25rem;
}

.chart-card .card-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
}

/* ── Activity feed ────────────────────────────────────────── */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.62rem 0;
    border-bottom: 1px solid var(--sp-color-bg-light, #f3f4f6);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 36px; height: 36px;
    border-radius: var(--sp-radius-sm, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.activity-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
}

.activity-sub {
    font-size: 0.7rem;
    color: var(--sp-color-text-muted, #9ca3af);
    margin-top: 0.1rem;
}

/* ── Top products ─────────────────────────────────────────── */
.top-prod-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.58rem 0;
    border-bottom: 1px solid var(--sp-color-bg-light, #f3f4f6);
}

.top-prod-row:last-child {
    border-bottom: none;
}

.top-prod-rank {
    width: 26px; height: 26px;
    border-radius: 7px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.top-prod-bar {
    flex: 1;
    height: 5px;
    border-radius: var(--sp-radius-pill, 500px);
    background: var(--sp-color-bg-light, #f3f4f6);
    overflow: hidden;
}

.top-prod-bar-fill {
    height: 100%;
    border-radius: var(--sp-radius-pill, 500px);
    background: linear-gradient(90deg,
        var(--sp-color-primary, #6d28d9),
        var(--sp-color-secondary, #8b5cf6));
}

/* ── Payment method pills ─────────────────────────────────── */
.pay-pill {
    border-radius: var(--sp-radius-sm, 8px);
    padding: 0.6rem 0.5rem;
    background: var(--sp-color-bg-grey, #f9fafb);
    text-align: center;
    flex: 1 1 30%;
    min-width: 0;
    border: 1px solid var(--sp-color-border, #e5e7eb);
}

.pay-pill-label {
    font-size: 0.63rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--sp-color-text-muted, #9ca3af);
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pay-pill-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--sp-color-text-main, #111827);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pay-pill-pct {
    font-size: 0.68rem;
    color: var(--sp-color-text-muted, #9ca3af);
    margin-top: 0.1rem;
}

/* ── Usage bars (subscription panel) ─────────────────────── */
.usage-bar {
    height: 5px;
    border-radius: var(--sp-radius-pill, 500px);
    background: var(--sp-color-bg-light, #f3f4f6);
    overflow: hidden;
    margin-top: 0.3rem;
}

.usage-bar-fill {
    height: 100%;
    border-radius: var(--sp-radius-pill, 500px);
    background: linear-gradient(90deg,
        var(--sp-color-primary, #6d28d9),
        var(--sp-color-secondary, #8b5cf6));
}

/* ── Cashier table ────────────────────────────────────────── */
.cashier-table th,
.cashier-table td {
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
}

.cashier-table th {
    color: var(--sp-color-text-muted, #9ca3af);
    font-weight: 600;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
}

.cashier-table td {
    border-bottom: 1px solid var(--sp-color-bg-light, #f3f4f6);
}

.cashier-avatar {
    width: 28px; height: 28px;
    border-radius: var(--sp-radius-sm, 8px);
    background: linear-gradient(135deg,
        var(--sp-color-secondary, #8b5cf6),
        var(--sp-color-primary, #6d28d9));
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.4rem;
    flex-shrink: 0;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .hero-name {
        font-size: 1.15rem;
    }
    .kpi-value {
        font-size: 1.12rem;
    }
}
