/* css/style.css */
:root {
    --primary-color: #1a2332;
    --secondary-color: #2c3e50;
    --accent-color: #3498db;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-bg: #f5f6fa;
    --dark-text: #2c3e50;
    --light-text: #ecf0f1;
    --border-color: #dcdde1;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--light-bg);
    color: var(--dark-text);
    min-height: 100vh;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

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

.login-logo i {
    font-size: 48px;
    color: var(--accent-color);
}

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

.login-logo p {
    color: #7f8c8d;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

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

.login-form .form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px 15px;
    transition: var(--transition);
    width: 100%;
}

.login-form .form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

.login-form .btn-login {
    background: var(--accent-color);
    color: white;
    padding: 12px;
    border: none;
    border-radius: var(--radius);
    width: 100%;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.login-form .btn-login:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--primary-color);
    color: var(--light-text);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

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

.sidebar-brand i {
    font-size: 32px;
    color: var(--accent-color);
}

.sidebar-brand h3 {
    margin: 10px 0 5px;
    font-size: 18px;
}

.sidebar-brand small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

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

.sidebar-menu .menu-label {
    padding: 10px 20px;
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

.sidebar-menu .menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-menu .menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-left-color: var(--accent-color);
}

.sidebar-menu .menu-item.active {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-left-color: var(--accent-color);
}

.sidebar-menu .menu-item i {
    width: 24px;
    margin-right: 12px;
    font-size: 16px;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 20px;
}

/* Top Navbar */
.top-navbar {
    background: white;
    padding: 15px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-navbar .page-title h4 {
    margin: 0;
    color: var(--primary-color);
}

.top-navbar .page-title small {
    color: #7f8c8d;
    font-size: 13px;
}

.top-navbar .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-navbar .user-info .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.top-navbar .user-info .logout-btn {
    color: var(--danger-color);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.top-navbar .user-info .logout-btn:hover {
    background: #fde8e8;
}

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

.card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

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

.card-header h5 {
    margin: 0;
    color: var(--primary-color);
}

.card-body {
    padding: 20px;
}

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

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.stat-card .stat-icon {
    font-size: 32px;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card .stat-label {
    color: #7f8c8d;
    font-size: 14px;
}

.stat-card .stat-change {
    font-size: 12px;
    margin-top: 5px;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.stat-card .stat-change.positive {
    background: #d4edda;
    color: #155724;
}

.stat-card .stat-change.negative {
    background: #f8d7da;
    color: #721c24;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

.table th {
    background: var(--light-bg);
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-text);
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.table tr:hover {
    background: #f8f9fa;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

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

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

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

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

.btn-success:hover {
    background: #27ae60;
}

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

.btn-danger:hover {
    background: #c0392b;
}

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

.btn-warning:hover {
    background: #e67e22;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

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

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

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control-sm {
    padding: 6px 10px;
    font-size: 13px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* 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.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
}

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

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

.modal-header h5 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
}

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

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    transition: .3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .top-navbar {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .login-container {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 13px;
    }
    
    .table th, .table td {
        padding: 8px 10px;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}