/* =========================================
   STOCKMANAGEMENT - CLEAN PROFESSIONAL THEME
   ========================================= */

:root {
    /* Primary Color Scheme - Professional Blue */
    --primary: #2c5da9;
    --primary-dark: #1e4178;
    --primary-light: #e8f0fa;
    --primary-lighter: #f5f9fd;

    /* Secondary Colors */
    --secondary: #5b8cc4;
    --secondary-light: #dce8f5;

    /* Success/Info/Warning/Danger */
    --success: #10b981;
    --success-light: #d1fae5;
    --info: #3b82f6;
    --info-light: #dbeafe;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;

    /* Neutral Colors - Clean & Professional */
    --bg-body: #f8fafb;
    --bg-card: #ffffff;
    --bg-hover: #f3f4f6;

    /* Light Sidebar */
    --sidebar-bg: linear-gradient(180deg, #ffffff 0%, #f8fafb 100%);
    --sidebar-text: #4b5563;
    --sidebar-hover: rgba(44, 93, 169, 0.08);
    --sidebar-active: var(--primary);
    --sidebar-border: #e5e7eb;

    /* Text Colors */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    /* Borders */
    --border: #e5e7eb;
    --border-light: #f3f4f6;

    /* Shadows - Subtle & Professional */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Layout */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 32px;
    min-height: calc(100vh - var(--header-height));
    transition: margin-left 0.3s ease;
}

@media (max-width: 992px) {
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
}

/* Cards - Clean & Professional */
.card-premium {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card-premium:hover {
    box-shadow: var(--shadow-md);
}

.card-header-premium {
    padding: 20px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
}

.card-title-premium {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: 24px;
}

/* Product Cards - CLEAN & SIMPLE */
.product-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(44, 93, 169, 0.15);
    transform: translateY(-2px);
}

.product-card-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.product-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.product-card-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.product-card-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--success-light);
    color: #047857;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.product-card-actions {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.product-card-btn {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.product-card-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.product-card-btn-secondary {
    background: white;
    color: var(--primary);
    border: 1px solid var(--border);
}

.product-card-btn-secondary:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.product-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.product-action-btn {
    padding: 8px;
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.product-action-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* KPI Cards - Clean Stat Cards */
.kpi-card {
    padding: 20px;
    border-radius: var(--radius);
    background: white;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    transition: all 0.3s;
}

.kpi-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--primary);
}

.kpi-card .kpi-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.kpi-card .kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.kpi-card .kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 12px;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9375rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 93, 169, 0.3);
}

.btn-light-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-light-primary:hover {
    background: #d0e2f3;
}

.btn-light {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-light:hover {
    background: var(--bg-hover);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.875rem;
}

/* ====== BOOTSTRAP BUTTON OVERRIDES - #2c5da9 ====== */
/* Override all Bootstrap primary buttons */
.btn-primary,
button.btn-primary,
a.btn-primary,
input[type="submit"].btn-primary {
    background-color: #2c5da9 !important;
    border-color: #2c5da9 !important;
    color: white !important;
}

.btn-primary:hover,
button.btn-primary:hover,
a.btn-primary:hover {
    background-color: #1e4178 !important;
    border-color: #1e4178 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(44, 93, 169, 0.3) !important;
}

.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background-color: #1e4178 !important;
    border-color: #1e4178 !important;
    box-shadow: 0 0 0 0.2rem rgba(44, 93, 169, 0.25) !important;
}

.btn-outline-primary {
    color: #2c5da9 !important;
    border-color: #2c5da9 !important;
}

.btn-outline-primary:hover {
    background-color: #2c5da9 !important;
    border-color: #2c5da9 !important;
    color: white !important;
}

/* Light primary button variations */
.btn-light-primary {
    background: #e8f0fa !important;
    color: #2c5da9 !important;
    border-color: transparent !important;
}

.btn-light-primary:hover {
    background: #d0e2f3 !important;
    color: #1e4178 !important;
}

/* Badges */
.badge {
    padding: 5px 12px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-success {
    background: var(--success-light);
    color: #047857;
}

.badge-warning {
    background: var(--warning-light);
    color: #92400e;
}

.badge-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.badge-info {
    background: var(--info-light);
    color: #1e40af;
}

.badge-soft-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-soft-success {
    background: var(--success-light);
    color: #047857;
}

.badge-soft-warning {
    background: var(--warning-light);
    color: #92400e;
}

/* Forms */
.form-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 8px;
    display: block;
}

.form-control,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 93, 169, 0.1);
}

/* DataTables */
table.dataTable {
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
}

table.dataTable thead th {
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 12px;
    border-bottom: 2px solid var(--border);
}

table.dataTable tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 0.9375rem;
}

table.dataTable tbody tr:hover {
    background: var(--bg-hover);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 16px;
    }

    .main-content {
        padding: 16px;
    }

    .kpi-card .kpi-value {
        font-size: 1.5rem;
    }


/* =========================================
   MOBILE COMPACT LIST & OPTIMIZATIONS
   ========================================= */

/* Compact List Item (Shared) */
.mobile-list-item {
    background: #fff;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}
.mobile-list-item:active, .mobile-list-item:hover {
    background-color: #f8fafc;
    color: inherit;
}
.mobile-list-item:last-child {
    border-bottom: none;
}
.mobile-icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

/* Mobile Padding Overrides */
@media (max-width: 767.98px) {
    /* Reduce container padding to maximize space */
    .container, .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    /* Tighter form spacing */
    .card-body {
        padding: 16px !important;
    }
}