/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #2c5aa0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 24px;
    font-weight: 700;
}

.header-center {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: none;
    border-radius: 25px;
    background: white;
    font-size: 14px;
    outline: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-box input:focus {
    box-shadow: 0 2px 20px rgba(0,0,0,0.15);
}

.header-right {
    display: flex;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.action-btn {
    position: relative;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.action-btn:hover {
    background: rgba(255,255,255,0.1);
}

.action-btn .badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff4757;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.user-btn:hover {
    background: rgba(255,255,255,0.2);
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #667eea;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    width: 280px;
    height: calc(100vh - 70px);
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    z-index: 999;
    overflow-y: auto;
}

.sidebar.collapsed {
    transform: translateX(-280px);
}

/* Mobile sidebar overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

.sidebar-content {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-title {
    padding: 0 20px 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 1px;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
}

.nav-link:hover {
    background: #f8f9fa;
    color: #2c5aa0;
    border-right-color: #2c5aa0;
}

.nav-item.active .nav-link {
    background: rgba(44,90,160,0.1);
    color: #2c5aa0;
    border-right-color: #2c5aa0;
    font-weight: 600;
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    margin-top: 70px;
    padding: 30px;
    min-height: calc(100vh - 70px);
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
}

.content-wrapper {
    max-width: 100%;
}

/* Page Header */
.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.page-subtitle {
    color: #666;
    font-size: 16px;
}

/* Cards */
.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border: none;
    margin-bottom: 30px;
    overflow: hidden;
}

.card-header {
    background: #2c5aa0;
    color: white;
    padding: 20px 25px;
    border: none;
    font-weight: 600;
    font-size: 18px;
}

.card-body {
    padding: 25px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #2c5aa0;
    box-shadow: 0 0 0 0.2rem rgba(44,90,160,0.25);
}

.form-select {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-select:focus {
    border-color: #2c5aa0;
    box-shadow: 0 0 0 0.2rem rgba(44,90,160,0.25);
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: #2c5aa0;
    border-color: #2c5aa0;
    color: white;
}

.btn-primary:hover {
    background: #1e3a6f;
    border-color: #1e3a6f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(44,90,160,0.3);
}

.btn-success {
    background: #198754;
    border-color: #198754;
    color: white;
}

.btn-success:hover {
    background: #157347;
    border-color: #157347;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(25,135,84,0.3);
}

.btn-warning {
    background: #fd7e14;
    border-color: #fd7e14;
    color: white;
}

.btn-warning:hover {
    background: #e55100;
    border-color: #e55100;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(253,126,20,0.3);
}

/* Tables */
.table-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #2c5aa0;
    color: white;
    border: none;
    padding: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}

.table tbody td {
    padding: 15px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border-left: 4px solid;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card.primary {
    border-left-color: #2c5aa0;
}

.stat-card.success {
    border-left-color: #198754;
}

.stat-card.warning {
    border-left-color: #fd7e14;
}

.stat-card.info {
    border-left-color: #0dcaf0;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.stat-title {
    font-size: 14px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.stat-card.primary .stat-icon {
    background: #2c5aa0;
}

.stat-card.success .stat-icon {
    background: #198754;
}

.stat-card.warning .stat-icon {
    background: #fd7e14;
}

.stat-card.info .stat-icon {
    background: #0dcaf0;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-change {
    font-size: 12px;
    font-weight: 600;
}

.stat-change.positive {
    color: #27ae60;
}

.stat-change.negative {
    color: #e74c3c;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    text-align: center;
    color: #667eea;
}

.loading-spinner i {
    font-size: 40px;
    margin-bottom: 10px;
    display: block;
}

/* Form Specific Styles */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Data Table Styles */
.data-table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    min-width: 800px;
}

.data-table th {
    white-space: nowrap;
    min-width: 120px;
}

.data-table td {
    white-space: nowrap;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .sidebar {
        transform: translateX(-280px);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .header-center {
        display: none;
    }
    
    .header-content {
        padding: 0 15px;
    }
    
    .main-content {
        padding: 20px 15px;
        margin-left: 0;
    }
    
    .sidebar {
        transform: translateX(-280px);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(25,135,84,0.1);
    color: #198754;
    border-left: 4px solid #198754;
}

.alert-danger {
    background: rgba(220,53,69,0.1);
    color: #dc3545;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background: rgba(253,126,20,0.1);
    color: #fd7e14;
    border-left: 4px solid #fd7e14;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #2c5aa0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e3a6f;
}
