:root {
    --primary-color: #4e73df;
    --secondary-color: #1cc88a;
    --danger-color: #e74a3b;
    --warning-color: #f6c23e;
    --dark-color: #5a5c69;
    --light-color: #f8f9fc;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fb;
}

.wrapper {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    min-height: 100vh;
}

/* Form Container */
.form-container {
    max-width: 400px;
    margin: 5rem auto;
    padding: 2rem;
    background: white;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
}

.form-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.form-container label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.form-container input, 
.form-container select, 
.form-container button {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 0.35rem;
    font-size: 1rem;
}

.form-container button {
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.form-container button:hover {
    background: #224abe;
}

.form-container .error {
    color: var(--danger-color);
    text-align: center;
    margin-bottom: 1rem;
}

.form-container .success {
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 1rem;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, #224abe 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    min-height: 100vh;
    -webkit-transition: all 0.3s;
    transition: all 0.3s;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-brand h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.sidebar-brand span {
    font-size: 0.8rem;
    opacity: 0.8;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
    flex: 1;
}

.sidebar-menu li {
    padding: 0;
}

.sidebar-menu li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 12px 20px;
    transition: all 0.3s;
    border-radius: 0;
    margin: 2px 8px;
    border-radius: 8px;
}

.sidebar-menu li a i {
    margin-right: 12px;
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

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

.sidebar-menu li.active a {
    color: white;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    margin: 1rem auto;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main Content Styles */
.main-content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    -webkit-transition: all 0.3s;
    transition: all 0.3s;
}

/* Header Styles */
.header {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 0.75rem 1rem;
    background: white;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 10;
}

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

.header-center {
    display: none;
    flex: 1;
    text-align: center;
}

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

@media (min-width: 576px) {
    .header-center {
        display: block;
    }
}

@media (min-width: 768px) {
    .header {
        padding: 1rem 2rem;
    }
}

.toggle-sidebar {
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--dark-color);
    transition: background 0.3s;
}

.toggle-sidebar:hover {
    background: rgba(0, 0, 0, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: #0fc70f;
}

.user-profile img {
    border-radius: 50%;
}

/* Main Content Area */
main {
    padding: 2rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    color: var(--dark-color);
    font-size: 1.75rem;
    font-weight: 600;
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    border-radius: 0.35rem;
    padding: 1.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    border-left: 0.25rem solid var(--primary-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.25rem 2rem 0 rgba(58, 59, 69, 0.2);
}

.card h3 {
    color: var(--dark-color);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card span {
    font-size: 1.5rem;
    font-weight: 700;
    color: #5a5c69;
}

/* Card Color Variants */
.card-success {
    border-left-color: var(--secondary-color);
    background: linear-gradient(135deg, #fff 0%, rgba(28, 200, 138, 0.05) 100%);
}

.card-success h3 {
    color: var(--secondary-color);
}

.card-success span {
    color: var(--secondary-color);
}

.card-warning {
    border-left-color: var(--warning-color);
    background: linear-gradient(135deg, #fff 0%, rgba(246, 194, 62, 0.05) 100%);
}

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

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

.card-danger {
    border-left-color: var(--danger-color);
    background: linear-gradient(135deg, #fff 0%, rgba(231, 74, 59, 0.05) 100%);
}

.card-danger h3 {
    color: var(--danger-color);
}

.card-danger span {
    color: var(--danger-color);
}

.card-primary {
    border-left-color: var(--primary-color);
    background: linear-gradient(135deg, #fff 0%, rgba(78, 115, 223, 0.05) 100%);
}

.card-primary h3 {
    color: var(--primary-color);
}

.card-primary span {
    color: var(--primary-color);
}

.card-purple {
    border-left-color: #9b59b6;
    background: linear-gradient(135deg, #fff 0%, rgba(155, 89, 182, 0.05) 100%);
}

.card-purple h3 {
    color: #9b59b6;
}

.card-purple span {
    color: #9b59b6;
}

.card-info {
    border-left-color: #17a2b8;
    background: linear-gradient(135deg, #fff 0%, rgba(23, 162, 184, 0.05) 100%);
}

.card-info h3 {
    color: #17a2b8;
}

.card-info span {
    color: #17a2b8;
}

/* Tables */
.tables-container {
    display: grid;
    gap: 2rem;
}

.table-section {
    background: white;
    border-radius: 0.35rem;
    padding: 1.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
}

.table-section h2 {
    color: var(--dark-color);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

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

table th {
    background-color: #f8f9fc;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 1px solid #e3e6f0;
}

table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e3e6f0;
    color: #5a5c69;
}

/* Responsive Styles */
@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        left: -280px;
        width: 280px;
        height: 100%;
        min-height: 100vh;
        top: 0;
        z-index: 1000;
        transition: left 0.3s ease-in-out;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.2);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .sidebar-brand h2, 
    .sidebar-menu li a span {
        display: inline-block;
    }
    
    .sidebar-menu {
        flex: 1;
        overflow-y: auto;
    }
    
    .sidebar-menu li a {
        justify-content: flex-start;
        padding: 14px 16px;
    }
    
    .sidebar-menu li a i {
        margin-right: 12px;
        font-size: 1.2rem;
    }
    
    .sidebar-toggle {
        margin: 1rem auto;
    }
    
    .main-content {
        width: 100%;
        margin-left: 0;
    }
    
    /* Mobile hamburger menu in header */
    .mobile-sidebar-toggle {
        display: flex !important;
    }
    
    /* Overlay for mobile sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

@media (min-width: 768px) {
    .sidebar {
        width: var(--sidebar-width);
    }
    
    .sidebar-brand h2, 
    .sidebar-menu li a span {
        display: inline-block;
    }
    
    .sidebar-menu li a {
        justify-content: flex-start;
    }
    
    .sidebar-menu li a i {
        margin-right: 12px;
    }
    
    .main-content {
        width: calc(100% - var(--sidebar-width));
        margin-left: var(--sidebar-width);
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .mobile-sidebar-toggle {
        display: none !important;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
}

/* Mobile sidebar toggle button */
.mobile-sidebar-toggle {
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--dark-color);
    transition: background 0.3s;
}

.mobile-sidebar-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Collapsed Sidebar State */
.sidebar-collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar-brand h2, 
.sidebar-collapsed .sidebar-menu li a span {
    display: none;
}

.sidebar-collapsed .sidebar-menu li a {
    justify-content: center;
}

.sidebar-collapsed .sidebar-menu li a i {
    margin-right: 0;
    font-size: 1.3rem;
}

/* Active Link Styling - Removed problematic oval border */

.main-content-expanded {
    width: calc(100% - var(--sidebar-collapsed-width));
    margin-left: var(--sidebar-collapsed-width);
}

