/**
 * Trading Portal Stylesheet
 * Professional and Modern UI Design
 */

/* ===== Variables ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --success-dark: #059669;
    --danger-color: #ef4444;
    --danger-dark: #dc2626;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #0f172a;
    --dark-secondary: #1e293b;
    --light-color: #f8fafc;
    --light-secondary: #f1f5f9;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --text-color: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --white: #ffffff;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-info: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --gradient-warm: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-cool: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 400;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

h1 { 
    font-size: 2.25rem;
    line-height: 1.2;
}

h2 { 
    font-size: 1.875rem;
    line-height: 1.3;
}

h3 { 
    font-size: 1.5rem;
    line-height: 1.4;
}

p { 
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.text-success { 
    color: var(--success-color);
    font-weight: 600;
}

.text-danger { 
    color: var(--danger-color);
    font-weight: 600;
}

.text-warning { 
    color: var(--warning-color);
    font-weight: 600;
}

.text-info { 
    color: var(--info-color);
    font-weight: 600;
}

/* ===== Layout ===== */
.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.page-header h1 {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header h1 i {
    -webkit-text-fill-color: var(--primary-color);
    color: var(--primary-color);
    display: inline-block;
}

.page-header h1 .btn,
.page-header h1 .btn-secondary {
    -webkit-text-fill-color: var(--white) !important;
    color: var(--white) !important;
    background: var(--secondary-color) !important;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    margin-left: auto;
}

.page-header h1 .btn:hover,
.page-header h1 .btn-secondary:hover {
    background: #475569 !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--white) !important;
}

.page-header h1 .btn i,
.page-header h1 .btn-secondary i {
    -webkit-text-fill-color: var(--white) !important;
    color: var(--white) !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ===== Header ===== */
.main-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    padding: 0.75rem 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-light);
    width: 100%;
}

.header-content {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow: visible;
    width: 100%;
}

.logo {
    font-size: 1.125rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    letter-spacing: -0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo i {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    flex: 0 1 auto;
    justify-content: flex-end;
    min-width: 0;
    overflow: visible;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 500;
    font-size: 0.75rem;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
    background: var(--light-color);
}

.nav-link:hover::before {
    width: 80%;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border-color);
    flex-shrink: 0;
    margin-left: 0.25rem;
    visibility: visible;
    opacity: 1;
    position: relative;
    z-index: 1;
}

.user-menu .nav-link {
    display: inline-flex;
    visibility: visible;
    opacity: 1;
}

.user-name {
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== Footer ===== */
.main-footer {
    background: var(--white);
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* ===== Cards ===== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.75rem 2rem;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.card-header h2 {
    margin: 0;
    font-size: 1.375rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--dark-color);
    font-weight: 700;
}

.card-header h2 i {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.card-body {
    padding: 2rem;
}

/* ===== Statistics Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.875rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 1600px) {
    .stats-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 0.75rem;
    }
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.875rem;
    }
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.875rem;
    }
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    transition: var(--transition);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
    border-color: var(--primary-light);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    color: var(--white);
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: visible;
}

.stat-icon i {
    font-size: 1.375rem;
    line-height: 1;
    display: inline-block;
}

.stat-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    transition: var(--transition);
}

.stat-card:hover .stat-icon::before {
    animation: shine 1.5s ease-in-out;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.bg-primary { 
    background: var(--gradient-primary);
}

.bg-success { 
    background: var(--gradient-success);
}

.bg-danger { 
    background: var(--gradient-danger);
}

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

.bg-info { 
    background: var(--gradient-info);
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-content h3 {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--dark-color);
    line-height: 1.2;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.stat-content p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    word-break: break-word;
    line-height: 1.3;
}

/* ===== Tables ===== */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9375rem;
    background: var(--white);
}

.table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 700;
    color: var(--dark-color);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-weight: 500;
}

.table tbody tr {
    transition: var(--transition-fast);
}

.table tbody tr:hover {
    background: linear-gradient(90deg, #f8fafc 0%, transparent 100%);
    transform: scale(1.01);
}

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

.table-sm th,
.table-sm td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    background: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    background: #475569;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    color: var(--white);
}

.btn-secondary i {
    color: var(--white) !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.btn-success {
    background: var(--gradient-success);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-success:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-sm i {
    font-size: 0.8125rem;
    display: inline-block;
    color: inherit;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-sm);
}

.badge-success {
    background: var(--gradient-success);
    color: var(--white);
}

.badge-danger {
    background: var(--gradient-danger);
    color: var(--white);
}

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

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    transition: var(--transition);
    background: var(--white);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

/* ===== Alerts ===== */
.alert {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    border-left: 4px solid;
    box-shadow: var(--shadow-sm);
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-color: var(--danger-color);
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-color: var(--info-color);
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-color: var(--success-color);
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-color: var(--warning-color);
}

/* ===== Login Page ===== */
.login-page {
    background: var(--gradient-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    padding: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header h1 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
    font-size: 2rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.login-form {
    margin-bottom: 1.5rem;
}

.login-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ===== Row & Column ===== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.75rem;
}

.col-md-6 {
    flex: 0 0 50%;
    padding: 0.75rem;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--light-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .col-md-6 {
        flex: 0 0 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1.25rem;
        gap: 0.75rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .stat-content h3 {
        font-size: 1.25rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    
    .stat-content p {
        font-size: 0.6875rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0 1rem;
    }
    
    .logo {
        font-size: 1.125rem;
        order: 1;
        flex: 0 0 auto;
        width: 100%;
    }
    
    .logo i {
        font-size: 1.125rem;
    }
    
    .main-nav {
        width: 100%;
        justify-content: space-between;
        order: 2;
        gap: 0.5rem;
        flex-wrap: wrap;
        align-items: center;
    }
    
    .main-nav > .nav-link {
        flex: 0 0 auto;
    }
    
    .main-nav .user-menu {
        width: 100%;
        order: 10;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-color);
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .user-menu {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        justify-content: space-between !important;
        gap: 0.75rem;
        align-items: center;
    }
    
    .user-menu .user-name {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex: 0 0 auto;
        order: 1;
    }
    
    .user-menu .nav-link {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex: 0 0 auto;
        order: 2;
        min-width: auto;
        width: auto;
        color: var(--text-secondary) !important;
        background: transparent !important;
    }
    
    .user-menu .nav-link:hover {
        color: var(--primary-color) !important;
        background: var(--light-color) !important;
    }
    
    .nav-link {
        font-size: 0.8125rem;
        padding: 0.5rem 0.75rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .page-header {
        padding: 1.5rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .stat-content h3 {
        font-size: 1.125rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    
    .stat-content p {
        font-size: 0.625rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    
    .header-content {
        padding: 0 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .logo {
        font-size: 1rem;
        order: 1;
        flex: 0 0 auto;
        width: 100%;
    }
    
    .logo i {
        font-size: 1rem;
    }
    
    .main-nav {
        width: 100%;
        justify-content: space-between;
        order: 2;
        gap: 0.5rem;
        flex-wrap: wrap;
        align-items: center;
    }
    
    .main-nav > .nav-link {
        flex: 0 0 auto;
    }
    
    .main-nav .user-menu {
        width: 100%;
        order: 10;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-color);
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .nav-link {
        font-size: 0.75rem;
        padding: 0.5rem;
        flex: 0 0 auto;
    }
    
    .nav-link > span:not(:first-child),
    .user-name > span {
        display: none;
    }
    
    .user-name {
        font-size: 0.75rem;
    }
    
    .user-menu {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        justify-content: space-between !important;
        gap: 0.75rem;
        align-items: center;
    }
    
    .user-menu .user-name {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex: 0 0 auto;
        order: 1;
    }
    
    .user-menu .nav-link {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex: 0 0 auto;
        order: 2;
        min-width: auto;
        width: auto;
        color: var(--text-secondary) !important;
        background: transparent !important;
    }
    
    .user-menu .nav-link:hover {
        color: var(--primary-color) !important;
        background: var(--light-color) !important;
    }
    
    .table {
        font-size: 0.8125rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
}

/* ===== Utilities ===== */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ===== Loading Animation ===== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ===== Font Awesome Icons ===== */
/* Ensure icons are visible and properly styled */
i.fas, i.far, i.fab, i.fa,
.fas, .far, .fab, .fa {
    display: inline-block !important;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    text-align: center;
}

/* Ensure icons inside stat-icon are visible */
.stat-icon i,
.stat-icon .fas,
.stat-icon .far,
.stat-icon .fab {
    display: inline-block !important;
    font-size: inherit !important;
    line-height: 1 !important;
    width: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== Print Styles ===== */
@media print {
    .main-header,
    .main-footer,
    .btn,
    .page-header a {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}
