@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #1a237e;
    --primary-light: #534bae;
    --primary-dark: #0d1442;
    --secondary-color: #ffc107;
    --secondary-light: #ffb300;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --info-color: #2196f3;
    --text-dark: #333;
    --text-light: #666;
    --text-muted: #999;
    --bg-light: #f5f5f5;
    --bg-white: #fff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

table {
    width: 100%;
    border-collapse: collapse;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Login Page Styles */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.login-box {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    width: 400px;
    max-width: 90%;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    height: 80px;
    width: auto;
}

.login-logo h1 {
    font-size: 24px;
    color: var(--primary-color);
    margin-top: 10px;
}

.login-logo p {
    color: var(--text-light);
    font-size: 12px;
}

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

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

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-dark);
}

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

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

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 15px;
    font-size: 12px;
}

.btn-xs {
    padding: 5px 10px;
    font-size: 11px;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--primary-color);
    color: var(--bg-white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 20px;
    margin-top: 10px;
}

.sidebar-header p {
    font-size: 11px;
    opacity: 0.8;
}

.sidebar-menu {
    padding: 15px 0;
}

.sidebar-menu ul li {
    position: relative;
}

.sidebar-menu ul li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    transition: all 0.3s;
    font-size: 14px;
}

.sidebar-menu ul li a:hover,
.sidebar-menu ul li a.active {
    background: rgba(255,255,255,0.1);
    color: var(--bg-white);
}

.sidebar-menu ul li a i {
    margin-right: 12px;
    font-size: 20px;
    width: 25px;
}

.sidebar-menu .submenu {
    display: none;
    background: rgba(0,0,0,0.2);
}

.sidebar-menu .submenu.active {
    display: block;
}

.sidebar-menu .submenu a {
    padding-left: 50px;
    font-size: 13px;
    color: #ffffff;
}

.main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
}

.header {
    background: var(--bg-white);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-left h3 {
    font-size: 20px;
    color: var(--primary-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
    border-radius: 5px;
    min-width: 180px;
    display: none;
    z-index: 1001;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 10px 15px;
    color: var(--text-dark);
    transition: background 0.3s;
}

.user-dropdown a:hover {
    background: var(--bg-light);
}

/* Page Content */
.page-content {
    padding: 30px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-header h2 {
    font-size: 24px;
    color: var(--primary-color);
}

.breadcrumb {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

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

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 16px;
    color: var(--primary-color);
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--bg-white);
}

.stat-icon.primary { background: var(--primary-color); }
.stat-icon.success { background: var(--success-color); }
.stat-icon.warning { background: var(--warning-color); }
.stat-icon.info { background: var(--info-color); }
.stat-icon.danger { background: var(--danger-color); }

.stat-content h4 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
}

.stat-content p {
    color: var(--text-light);
    font-size: 13px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

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

.data-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
    font-size: 13px;
    text-transform: uppercase;
}

.data-table tr:hover {
    background: var(--bg-light);
}

.data-table .actions {
    display: flex;
    gap: 5px;
}

.data-table .btn {
    padding: 5px 10px;
    font-size: 12px;
}

/* Status Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    display: inline-block;
}

.badge-success { background: #e8f5e9; color: var(--success-color); }
.badge-warning { background: #fff3e0; color: var(--warning-color); }
.badge-danger { background: #ffebee; color: var(--danger-color); }
.badge-info { background: #e3f2fd; color: var(--info-color); }
.badge-primary { background: #e8eaf6; color: var(--primary-color); }

/* Form Layouts */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success { background: #e8f5e9; border-left: 4px solid var(--success-color); }
.alert-danger { background: #ffebee; border-left: 4px solid var(--danger-color); }
.alert-warning { background: #fff3e0; border-left: 4px solid var(--warning-color); }
.alert-info { background: #e3f2fd; border-left: 4px solid var(--info-color); }

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

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 8px;
    width: 600px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 25px;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

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

.tab-content {
    display: none;
}

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

/* Pagination */
.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
}

.pagination a:hover {
    background: var(--bg-light);
}

.pagination .active {
    background: var(--primary-color);
    color: var(--bg-white);
    border-color: var(--primary-color);
}

/* Search Box */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

/* Filters */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filters select,
.filters input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 13px;
}

/* Print Styles */
@media print {
    .sidebar,
    .header,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        width: 100%;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        gap: 15px;
    }
}

/* Charts */
.chart-container {
    height: 300px;
    margin-bottom: 20px;
}

/* Calendar */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    padding: 10px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
}

.calendar-day.header {
    font-weight: 600;
    background: var(--bg-light);
}

.calendar-day.today {
    background: var(--primary-color);
    color: var(--bg-white);
}

.calendar-day.has-event {
    background: #e8eaf6;
    cursor: pointer;
}

/* File Upload */
.file-upload {
    border: 2px dashed var(--border-color);
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload:hover {
    border-color: var(--primary-color);
    background: #f8f9fa;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
}

.empty-state i {
    font-size: 60px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state h4 {
    color: var(--text-dark);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-light);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-dark);
    color: var(--bg-white);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Notification Badge */
.notification-badge {
    position: relative;
}

.notification-badge::after {
    content: '';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: var(--danger-color);
    border-radius: 50%;
    font-size: 10px;
    color: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer */
.footer {
    background: var(--bg-white);
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer p {
    color: var(--text-muted);
    font-size: 12px;
}