/* ==========================================================================
   StoreManager Unified Design System
   ========================================================================== */

:root {
    --sm-font-stack: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Responsive Font Sizes */
    --sm-title-size: 1.25rem;
    --sm-subtitle-size: 0.8rem;
    
    /* Layout Variables */
    --sm-card-radius: 12px;
    --sm-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.02);
    
    /* Color Palette */
    --sm-text-color: #1f2937;       /* Slate 800 */
    --sm-muted-color: #6b7280;      /* Slate 500 */
    --sm-bg-light: #f8fafc;
    --sm-border-color: #e5e7eb;
}

/* Tablet & Desktop Scaling overrides */
@media (min-width: 768px) {
    :root {
        --sm-title-size: 1.55rem;
        --sm-subtitle-size: 0.875rem;
    }
}

/* Page Containers */
.sm-page-container {
    font-family: var(--sm-font-stack);
    padding: 0.5rem;
}

@media (min-width: 768px) {
    .sm-page-container {
        padding: 1.25rem;
    }
}

/* ──────────────────────────────────────────────────────────────────────────
   Page Header Layout
   ────────────────────────────────────────────────────────────────────────── */
.sm-page-header {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--sm-border-color);
}

.sm-page-title {
    font-size: var(--sm-title-size);
    font-weight: 700;
    color: var(--sm-text-color);
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.sm-page-subtitle {
    font-size: var(--sm-subtitle-size);
    color: var(--sm-muted-color);
    margin-bottom: 0;
    line-height: 1.4;
}

/* ──────────────────────────────────────────────────────────────────────────
   Cards & Content Layouts
   ────────────────────────────────────────────────────────────────────────── */
.sm-card {
    background: #ffffff;
    border-radius: var(--sm-card-radius);
    box-shadow: var(--sm-card-shadow);
    border: 1px solid var(--sm-border-color);
    margin-bottom: 1rem;
}

/* ──────────────────────────────────────────────────────────────────────────
   Table Cards & Tables
   ────────────────────────────────────────────────────────────────────────── */
.sm-table-card {
    background: #ffffff;
    border-radius: var(--sm-card-radius);
    box-shadow: var(--sm-card-shadow);
    border: 1px solid var(--sm-border-color);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.sm-table-card table {
    margin-bottom: 0;
    font-size: 0.85rem;
}

.sm-table-card thead th, 
.sm-table-card table thead tr th {
    background-color: #f9fafb !important;
    color: var(--sm-muted-color) !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid var(--sm-border-color) !important;
}

.sm-table-card tbody td, 
.sm-table-card table tbody tr td {
    padding: 0.75rem 1rem !important;
    font-size: 0.825rem !important;
    border-bottom: 1px solid #f3f4f6 !important;
    vertical-align: middle !important;
}

/* Compact layout for narrow screens */
@media (max-width: 576px) {
    .sm-table-card tbody td, 
    .sm-table-card table tbody tr td {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8rem !important;
    }
}

/* ──────────────────────────────────────────────────────────────────────────
   Time Clock Specific Components
   ────────────────────────────────────────────────────────────────────────── */
.sm-timeclock-shell {
    max-width: 56rem;
    margin: 0 auto;
}

.sm-timeclock-list-item {
    border: 1px solid #f1f3f5;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    transition: background-color 0.2s ease;
}

.sm-timeclock-list-item.active {
    background: #dcfce7;
    border-color: #bbf7d0;
}

.sm-timeclock-list-item.inactive {
    background: #f8f9fa;
    border-color: #e5e7eb;
}

/* ──────────────────────────────────────────────────────────────────────────
   FindStock (Search / Dashboard) Styles
   ────────────────────────────────────────────────────────────────────────── */
.sm-stat-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #f1f3f5;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.sm-stat-label {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 4px;
}

.sm-stat-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: #111827;
    line-height: 1;
}

.sm-stat-icon {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.sm-fixed-bottom-end {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.sm-fixed-bottom-left {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    padding: 0 10px;
    background-color: white;
}

/* ──────────────────────────────────────────────────────────────────────────
   User Management & Admin Screens Premium Styles
   ────────────────────────────────────────────────────────────────────────── */
.sm-manage-users-container {
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    min-height: 100vh;
    padding-bottom: 2rem;
}

.sm-alert-premium {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08) !important;
    margin-bottom: 1.5rem !important;
    padding: 1rem 1.25rem !important;
}

.sm-alert-success-premium {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
    color: #15803d !important;
    border-left: 4px solid #16a34a !important;
}

.sm-alert-danger-premium {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
    color: #991b1b !important;
    border-left: 4px solid #dc2626 !important;
}

.sm-stat-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    border: 1px solid #bfdbfe;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.15);
    transition: all 0.3s ease;
}

.sm-stat-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

.sm-stat-badge-icon {
    margin-right: 0.5rem;
    font-size: 1rem;
}

.sm-users-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.sm-user-card-wrapper {
    transition: all 0.3s ease;
}

.sm-user-card-wrapper:hover {
    transform: translateY(-4px);
}

.sm-loading-container, .sm-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #f3f4f6;
    margin-bottom: 1.5rem;
}

.sm-loading-spinner {
    display: inline-block;
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: sm-spin 0.8s linear infinite;
}

@keyframes sm-spin {
    to { transform: rotate(360deg); }
}

.sm-badge-role {
    display: inline-block;
    background: #e0e7ff;
    color: #4f46e5;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* ──────────────────────────────────────────────────────────────────────────
   Purchase Orders Mobile Responsive Helpers
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .po-header-bar {
        padding: 10px 14px !important;
        border-radius: 10px !important;
        margin-bottom: 12px !important;
    }

    .po-card {
        border-radius: 10px !important;
        margin-bottom: 12px !important;
    }

    .po-card-header {
        padding: 8px 12px !important;
    }

    .po-card-body {
        padding: 10px 12px !important;
    }

    /* Prevent accidental auto-zoom on mobile safari while maintaining sleek look */
    .form-control-compact,
    .receive-item-card input[type="number"],
    .receive-item-card input[type="text"] {
        font-size: 16px !important;
    }

    /* Ensure touch targets have comfortable minimums */
    .receive-item-card .btn,
    .sm-po-card .btn {
        min-height: 38px;
    }
}

