/* components.css - Component-specific styles for SalesPal v2 */

/* ============================================================
   Status Badges
   ============================================================ */
.sp-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.sp-status-active   { background: #dcfce7; color: #166534; }
.sp-status-inactive { background: #f3f4f6; color: #6b7280; }
.sp-status-pending  { background: #fef3c7; color: #92400e; }
.sp-status-error    { background: #fee2e2; color: #991b1b; }
.sp-status-info     { background: #dbeafe; color: #1e40af; }

.sp-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}


/* ============================================================
   Stat Cards (dashboard widgets)
   ============================================================ */
.sp-stat-card {
    text-align: center;
    padding: 1rem;
}

.sp-stat-card .sp-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.sp-stat-card .sp-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.25rem;
}

.sp-stat-card .sp-stat-delta {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.sp-stat-delta.positive { color: #16a34a; }
.sp-stat-delta.negative { color: #dc2626; }


/* ============================================================
   Progress Indicators
   ============================================================ */
.sp-progress-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sp-progress-ring .sp-progress-label {
    position: absolute;
    font-size: 0.875rem;
    font-weight: 700;
}

.sp-progress-bar {
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    overflow: hidden;
}

.sp-progress-bar .sp-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.sp-progress-fill.green  { background: #16a34a; }
.sp-progress-fill.yellow { background: #eab308; }
.sp-progress-fill.red    { background: #dc2626; }
.sp-progress-fill.blue   { background: #2563eb; }


/* ============================================================
   Tier Badges
   ============================================================ */
.sp-tier {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sp-tier-bronze   { background: #fef3c7; color: #92400e; }
.sp-tier-silver   { background: #f3f4f6; color: #374151; }
.sp-tier-gold     { background: #fef9c3; color: #854d0e; border: 1px solid #fbbf24; }
.sp-tier-platinum { background: #ede9fe; color: #5b21b6; border: 1px solid #a78bfa; }


/* ============================================================
   Step Indicator
   ============================================================ */
.sp-steps {
    display: flex;
    gap: 2px;
}

.sp-steps .sp-step {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e5e7eb;
    color: #6b7280;
}

.sp-steps .sp-step:first-child { border-radius: 6px 0 0 6px; }
.sp-steps .sp-step:last-child  { border-radius: 0 6px 6px 0; }
.sp-steps .sp-step.active      { background: #43B02A; color: #fff; }
.sp-steps .sp-step.done        { background: #16a34a; color: #fff; }


/* ============================================================
   Empty State
   ============================================================ */
.sp-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #9ca3af;
}

.sp-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.sp-empty-text {
    font-size: 0.9rem;
}


/* ============================================================
   Action Buttons (context-specific)
   ============================================================ */
.sp-action-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sp-action-group .sp-btn {
    min-height: 44px;
}


/* ============================================================
   Denomination Grid (Cash Counter)
   ============================================================ */
.sp-denom-grid {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
    align-items: center;
}

.sp-denom-grid .sp-denom-label {
    font-weight: 700;
    min-width: 60px;
}

.sp-denom-grid .sp-denom-subtotal {
    text-align: right;
    font-weight: 600;
    min-width: 80px;
}


/* ============================================================
   Responsive Table Helpers
   ============================================================ */
@media (max-width: 768px) {
    .sp-table-stack td,
    .sp-table-stack th {
        display: block;
        width: 100%;
        text-align: left;
    }

    .sp-table-stack thead {
        display: none;
    }

    .sp-table-stack tr {
        display: block;
        border-bottom: 2px solid #e5e7eb;
        padding: 0.5rem 0;
    }

    .sp-table-stack td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: #6b7280;
        text-transform: uppercase;
        display: block;
        margin-bottom: 0.15rem;
    }
}


/* ============================================================
   Loading Skeleton
   ============================================================ */
.sp-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: sp-shimmer 1.5s infinite;
    border-radius: 4px;
}

.sp-skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.sp-skeleton-card {
    height: 80px;
    border-radius: 12px;
}

@keyframes sp-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
