:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --sidebar-width: 260px;
    --header-height: 70px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
}

/* Modern Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.app-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 40px;
    text-decoration: none;
    color: var(--text-primary);
}

.app-header .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.app-header .logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.app-header .search-bar {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
}

.app-header .search-bar input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    font-size: 14px;
    transition: all 0.2s;
}

.app-header .search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.app-header .header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.app-header .notification-icon {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bg-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.app-header .notification-icon:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.app-header .notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.app-header .user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--bg-color);
    cursor: pointer;
    transition: all 0.2s;
}

.app-header .user-profile:hover {
    background: #f1f5f9;
}

.app-header .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.app-header .user-info {
    display: flex;
    flex-direction: column;
}

.app-header .user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.app-header .user-email {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Sidebar Navigation */
.app-sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 24px 0;
    overflow-y: auto;
    z-index: 999;
}

.app-sidebar .nav-item {
    margin: 4px 12px;
}

.app-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.app-sidebar .nav-link i {
    width: 20px;
    min-width: 20px;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
}

.app-sidebar .nav-link:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.app-sidebar .nav-link.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.app-sidebar .nav-link.active i {
    color: var(--primary-color);
}

/* Main Content Area */
.app-main {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 32px;
    min-height: calc(100vh - var(--header-height));
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-header p.text-muted {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Cards */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    background: var(--card-bg);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

/* Stat Cards */
.stat-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.stat-card.success {
    border-left: 4px solid var(--success-color);
}

.stat-card.success .stat-value {
    color: var(--success-color);
}

.stat-card.info {
    border-left: 4px solid var(--info-color);
}

.stat-card.info .stat-value {
    color: var(--info-color);
}

.stat-card.warning {
    border-left: 4px solid var(--warning-color);
}

.stat-card.warning .stat-value {
    color: var(--warning-color);
}

/* Buttons */
.btn {
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

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

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

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

/* Tables */
.table {
    margin-bottom: 0;
}

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

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

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

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 12px;
}

.badge.bg-success {
    background: var(--success-color) !important;
}

.badge.bg-warning {
    background: var(--warning-color) !important;
}

.badge.bg-info {
    background: var(--info-color) !important;
}

.badge.bg-danger {
    background: var(--danger-color) !important;
}

/* Forms */
.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
    transition: all 0.2s;
}

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

.form-label {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Alerts */
.alert {
    border-radius: 12px;
    border: none;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Dropdown */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 8px;
    margin-top: 8px;
}

.dropdown-item {
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: var(--bg-color);
}

/* Modals */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 20px 24px;
}

/* Tabs */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 12px 20px;
    font-weight: 500;
    border-radius: 0;
}

.nav-tabs .nav-link:hover {
    border-bottom-color: var(--border-color);
    color: var(--text-primary);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: transparent;
}

/* Responsive */
@media (max-width: 1024px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .app-sidebar.show {
        transform: translateX(0);
    }
    
    .app-main {
        margin-left: 0;
    }
    
    .app-header .search-bar {
        display: none;
    }
}

@media (max-width: 768px) {
    .app-main {
        padding: 20px;
    }
    
    .stat-card .stat-value {
        font-size: 24px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
}

/* Utility Classes */
.text-muted {
    color: var(--text-secondary) !important;
}

.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.rounded-lg {
    border-radius: 12px !important;
}

/* Notification Dropdown */
.notification-dropdown {
    max-width: 380px;
    max-height: 500px;
    overflow-y: auto;
}

.notification-dropdown .dropdown-item {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 4px;
}

.notification-dropdown .dropdown-item strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.notification-dropdown .dropdown-item small {
    color: var(--text-secondary);
    font-size: 12px;
}
