/**
 * MSA ERP Modern Design System
 * Consistent styling for all modules
 * Based on modules 1-5 (Dashboard, PI, CI, Containers, GRNs)
 */

/* ============================================
   1. STAT CARDS
   ============================================ */

.msa-stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    height: 100%;
}

.msa-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.msa-stat-card.border-left-primary {
    border-left: 4px solid #667eea;
}

.msa-stat-card.border-left-success {
    border-left: 4px solid #10b981;
}

.msa-stat-card.border-left-danger {
    border-left: 4px solid #ef4444;
}

.msa-stat-card.border-left-warning {
    border-left: 4px solid #f59e0b;
}

.msa-stat-card.border-left-info {
    border-left: 4px solid #3b82f6;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-icon.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-icon.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.stat-icon.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.stat-icon.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   2. GRADIENT HEADERS
   ============================================ */

.gradient-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
}

.gradient-header h1,
.gradient-header h2,
.gradient-header h3 {
    margin: 0;
    color: white;
    font-weight: 700;
}

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* ============================================
   3. STATUS BADGES
   ============================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.status-badge-draft {
    background-color: #f3f4f6;
    color: #6b7280;
}

.status-badge-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge-approved,
.status-badge-posted {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge-paid {
    background-color: #a7f3d0;
    color: #064e3b;
}

.status-badge-rejected {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge-cancelled {
    background-color: #f3f4f6;
    color: #374151;
}

/* ============================================
   4. MODERN CARDS
   ============================================ */

.msa-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.2s ease;
}

.msa-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.msa-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.msa-card-header h3,
.msa-card-header h4 {
    margin: 0;
    color: #111827;
    font-weight: 600;
}

.msa-card-body {
    padding: 1.5rem;
}

/* ============================================
   5. MODERN BUTTONS
   ============================================ */

.btn-modern-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    color: white;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-modern-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-modern-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    color: white;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-modern-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    color: white;
}

.btn-modern-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    color: white;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-modern-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    color: white;
}

.btn-modern-outline {
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    color: #667eea;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-modern-outline:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* ============================================
   6. FILTER SECTION
   ============================================ */

.filter-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.filter-section .form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.filter-section .form-control,
.filter-section .form-select {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.filter-section .form-control:focus,
.filter-section .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* ============================================
   7. MODERN TABLE
   ============================================ */

.msa-table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.msa-table {
    width: 100%;
    margin-bottom: 0;
}

.msa-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.msa-table thead th {
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    color: white;
}

.msa-table tbody tr {
    transition: all 0.15s ease;
    border-bottom: 1px solid #f3f4f6;
}

.msa-table tbody tr:hover {
    background-color: #f9fafb;
    transform: scale(1.01);
}

.msa-table tbody td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    font-size: 0.875rem;
    color: #374151;
}

.msa-table tbody tr:last-child {
    border-bottom: none;
}

/* ============================================
   8. INFO ROWS (for detail pages)
   ============================================ */

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.info-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.info-value {
    font-size: 0.875rem;
    color: #111827;
    font-weight: 600;
}

/* ============================================
   9. APPROVAL WORKFLOW
   ============================================ */

.approval-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.approval-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.approval-status {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.approval-status.pending {
    background-color: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.approval-status.approved {
    background-color: #d1fae5;
    border-left: 4px solid #10b981;
}

.approval-status.rejected {
    background-color: #fee2e2;
    border-left: 4px solid #ef4444;
}

/* ============================================
   10. CURRENCY BADGES
   ============================================ */

.currency-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.currency-badge.usd {
    background-color: #dbeafe;
    color: #1e40af;
}

.currency-badge.uzs {
    background-color: #fef3c7;
    color: #92400e;
}

.currency-badge.eur {
    background-color: #ede9fe;
    color: #5b21b6;
}

.currency-badge.irr {
    background-color: #fee2e2;
    color: #991b1b;
}

/* ============================================
   11. CHART CONTAINERS
   ============================================ */

.chart-container {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.chart-header {
    margin-bottom: 1.5rem;
}

.chart-header h3 {
    margin: 0;
    color: #111827;
    font-weight: 600;
    font-size: 1.25rem;
}

/* ============================================
   12. PAGE HEADERS
   ============================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.page-title .gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================
   13. EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.empty-state i {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #374151;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

/* ============================================
   14. ACTION CARDS
   ============================================ */

.action-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    text-decoration: none;
    display: block;
    height: 100%;
}

.action-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateX(8px);
}

.action-card h4 {
    color: #111827;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.action-card p {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
}

/* ============================================
   15. RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {
    .stat-value {
        font-size: 1.5rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .gradient-header {
        padding: 1.5rem;
    }

    .filter-section {
        padding: 1rem;
    }
}

/* ============================================
   16. LOADING STATES
   ============================================ */

.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

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

/* ============================================
   17. UTILITY CLASSES
   ============================================ */

.shadow-modern {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.shadow-modern-lg {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.rounded-modern {
    border-radius: 12px;
}

.border-modern {
    border: 1px solid #e5e7eb;
}

.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   18. NUMBER INPUT FORMATTING
   ============================================ */

/* Thousands separator number inputs */
input.number-separator {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
}

input.number-separator:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
