/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --secondary-color: #3f37c9;
    --accent-color: #4cc9f0;
    --success-color: #4ade80;
    --danger-color: #f43f5e;
    --warning-color: #f59e0b;
    --info-color: #0ea5e9;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --gray-color: #64748b;
    --gray-light: #e2e8f0;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f7fa;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preloader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--gray-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Header */
.main-header {
    background: white;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

.logo i {
    color: var(--primary-color);
    font-size: 2rem;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: var(--light-color);
    border-radius: var(--border-radius);
}

.user-info i {
    font-size: 1.2rem;
    color: var(--gray-color);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: var(--dark-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

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

.nav-link-primary {
    background: var(--primary-color);
    color: white !important;
}

.nav-link-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--dark-color);
    margin: 5px 0;
    border-radius: 3px;
    transition: var(--transition);
}

/* Flash Messages */
.flash-message {
    padding: 15px 0;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.flash-error {
    background: var(--danger-color);
    color: white;
}

.flash-warning {
    background: var(--warning-color);
    color: white;
}

.flash-message .container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flash-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: auto;
    opacity: 0.8;
    transition: var(--transition);
}

.flash-close:hover {
    opacity: 1;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 160px);
    padding: 30px 0;
}

.breadcrumbs {
    margin-bottom: 20px;
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    gap: 10px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: var(--gray-color);
}

.breadcrumb-item a {
    color: var(--gray-color);
}

.breadcrumb-item.active {
    color: var(--dark-color);
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin-left: 10px;
}

.page-title {
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 10px;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Footer */
.main-footer {
    background: var(--dark-color);
    color: white;
    padding: 30px 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-info p {
    margin-bottom: 5px;
    color: var(--gray-light);
}

.footer-info a {
    color: var(--accent-color);
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: white;
    opacity: 0.8;
    transition: var(--transition);
}

.footer-links a:hover {
    opacity: 1;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
    margin-bottom: 30px;
    transition: var(--transition);
}

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

.card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gray-light);
}

.card-header h3 {
    margin-bottom: 0;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-control.is-valid {
    border-color: var(--success-color);
}

.invalid-feedback {
    display: block;
    margin-top: 5px;
    color: var(--danger-color);
    font-size: 14px;
}

.valid-feedback {
    display: block;
    margin-top: 5px;
    color: var(--success-color);
    font-size: 14px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--dark-color);
}

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

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

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline-primary:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 18px;
}

.btn-block {
    width: 100%;
}

/* Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

.col-1 { flex: 0 0 8.33%; max-width: 8.33%; }
.col-2 { flex: 0 0 16.66%; max-width: 16.66%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.33%; max-width: 33.33%; }
.col-5 { flex: 0 0 41.66%; max-width: 41.66%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.33%; max-width: 58.33%; }
.col-8 { flex: 0 0 66.66%; max-width: 66.66%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.33%; max-width: 83.33%; }
.col-11 { flex: 0 0 91.66%; max-width: 91.66%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.5s ease-out;
}

.alert-success {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.alert-danger {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning-color);
    color: var(--warning-color);
}

.alert-info {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid var(--info-color);
    color: var(--info-color);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
}

.table th {
    background: var(--light-color);
    font-weight: 600;
    color: var(--dark-color);
}

.table tbody tr:hover {
    background: var(--light-color);
}

/* Mobile Menu */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: white;
    z-index: 1002;
    transition: var(--transition);
    box-shadow: var(--box-shadow-lg);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--gray-color);
}

.mobile-menu-body {
    padding: 20px;
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--light-color);
    border-radius: var(--border-radius);
}

.mobile-user-info i {
    font-size: 2rem;
    color: var(--primary-color);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: var(--dark-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

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

/* Responsive */
@media (max-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .main-nav .nav-links,
    .main-nav .user-info {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .header-content {
        position: relative;
    }
    
    .mobile-menu-overlay.active,
    .mobile-menu.active {
        display: block;
    }
    
    .row {
        flex-direction: column;
    }
    
    .col {
        width: 100%;
        max-width: 100%;
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .card {
        padding: 20px;
    }
}