/* Color Scheme */
:root {
    --color-red: #DC3545;
    --color-blue: #007BFF;
    --color-green: #28A745;
    --color-black: #212529;
    --color-gray: #6C757D;
    --color-light-gray: #F8F9FA;
    --color-white: #FFFFFF;
    --sidebar-width: 260px;
    --navbar-height: 70px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #F5F5F5;
    color: var(--color-black);
    line-height: 1.6;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--color-black) 0%, #2c3e50 100%);
    color: var(--color-white);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background-color: rgba(0,0,0,0.2);
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-white);
    text-align: center;
    letter-spacing: 1px;
}

.sidebar-nav {
    padding: 20px 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav-bottom {
    margin-top: auto;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: rgba(255,255,255,0.1);
    color: var(--color-white);
    border-left-color: var(--color-blue);
}

.nav-item.active {
    background-color: rgba(0,123,255,0.2);
    color: var(--color-white);
    border-left-color: var(--color-blue);
    font-weight: 600;
}

.nav-icon {
    margin-right: 12px;
    font-size: 18px;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar Styles */
.navbar {
    height: var(--navbar-height);
    background-color: var(--color-white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--color-black);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-toggle:hover span {
    background-color: var(--color-blue);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-black);
}

.navbar-right {
    display: flex;
    align-items: center;
}

.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    color: var(--color-black);
    font-size: 14px;
    font-weight: 500;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.user-menu-btn:hover {
    background-color: var(--color-light-gray);
}

.user-name {
    color: var(--color-black);
}

.user-arrow {
    font-size: 10px;
    color: var(--color-gray);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--color-white);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 5px;
    min-width: 180px;
    margin-top: 5px;
    overflow: hidden;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: var(--color-black);
    text-decoration: none;
    transition: background-color 0.2s;
}

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

.dropdown-item span:first-child {
    font-size: 16px;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 30px;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 20px;
}

.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid var(--color-green);
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--color-red);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--color-blue);
}

.alert-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0;
    margin-left: 15px;
}

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

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

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background-color: var(--color-white);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 40px;
}

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

.login-logo {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: 10px;
}

.login-subtitle {
    color: var(--color-gray);
    font-size: 14px;
}

.login-form {
    margin-top: 30px;
}

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

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

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

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

.btn-success:hover {
    background-color: #218838;
}

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

.btn-danger:hover {
    background-color: #c82333;
}

.btn-block {
    width: 100%;
    text-align: center;
}

/* Card Styles */
.card {
    background-color: var(--color-white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 20px;
}

.card-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-black);
    margin: 0;
}

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

.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--color-white);
    border-radius: 5px;
    overflow: hidden;
}

.table thead {
    background-color: var(--color-black);
    color: var(--color-white);
}

.table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

/* Sortable Header Styles */
.sortable-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sortable-header span {
    flex: 1;
}

.sort-buttons {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sort-btn {
    display: inline-block;
    width: 18px;
    height: 12px;
    line-height: 10px;
    text-align: center;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.2s;
    border-radius: 2px;
    padding: 0;
}

.sort-btn:hover {
    color: var(--color-white);
    background-color: rgba(255, 255, 255, 0.2);
}

.sort-btn.active {
    color: var(--color-blue);
    background-color: rgba(0, 123, 255, 0.3);
    font-weight: bold;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
}

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

.table tbody tr:last-child td {
    border-bottom: none;
}

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

.stat-card {
    background: linear-gradient(135deg, var(--color-white) 0%, #f8f9fa 100%);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid;
}

.stat-card.red {
    border-left-color: var(--color-red);
}

.stat-card.blue {
    border-left-color: var(--color-blue);
}

.stat-card.green {
    border-left-color: var(--color-green);
}

.stat-card.black {
    border-left-color: var(--color-black);
}

.stat-label {
    font-size: 14px;
    color: var(--color-gray);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-black);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

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

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

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

.badge-blue {
    background-color: #cfe2ff;
    color: #084298;
}

/* Button Sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Form Text */
.form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--color-gray);
}

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

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

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Additional spacing */
.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content-area {
        padding: 15px;
    }
    
    .card {
        padding: 15px;
    }
    
    .table-container {
        overflow-x: scroll;
    }
    
    .navbar {
        padding: 0 15px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .navbar-right {
        gap: 10px;
    }
    
    .navbar-right .btn-sm {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .navbar-right .btn-sm span:last-child {
        display: none;
    }
}

