:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #1abc9c;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-color: #6c757d;
    --sidebar-width: 250px;
    --header-height: 60px;
    --font-primary: 'Roboto', sans-serif;
}

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

body {
    font-family: var(--font-primary);
    background-color: #f5f5f5;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to right bottom, var(--primary-color), var(--secondary-color));
}

.login-container {
    width: 100%;
    max-width: 400px;
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 10px;
    margin-bottom: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.login-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-btn:hover {
    background-color: var(--secondary-color);
}

/* Admin Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--dark-color);
    color: #fff;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-item {
    display: block;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.menu-item:hover, .menu-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-left-color: var(--primary-color);
}

.menu-item i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    bottom: 0;
    background-color: var(--dark-color);
}

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

.main-content.expanded {
    margin-left: 70px;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .menu-item span, 
.sidebar.collapsed .sidebar-footer span {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 1.5rem 0.5rem;
}

.sidebar.collapsed .sidebar-header h2 {
    font-size: 0;
}

.sidebar.collapsed .sidebar-header::after {
    content: 'AP';
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

.sidebar.collapsed .menu-item {
    padding: 0.75rem 0;
    text-align: center;
}

.sidebar.collapsed .menu-item i {
    margin-right: 0;
    font-size: 1.2rem;
}

.sidebar.collapsed .sidebar-footer {
    padding: 1rem 0;
}

.header {
    height: var(--header-height);
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-color);
    cursor: pointer;
}

.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dark-color);
}

.user-btn img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    min-width: 180px;
    margin-top: 0.5rem;
    display: none;
}

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

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--dark-color);
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f1f1;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item i {
    margin-right: 0.5rem;
    width: 20px;
    text-align: center;
}

.content {
    padding: 1.5rem;
    flex: 1;
}

/* Cards */
.card {
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.2rem;
    margin: 0;
    color: var(--dark-color);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f1f1f1;
}

/* Dashboard */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

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

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

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

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

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

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

.stat-icon {
    margin-bottom: 1rem;
    font-size: 2rem;
    color: var(--gray-color);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: var(--gray-color);
    font-weight: 500;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    margin: 1rem 0;
}

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

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

.table th, .table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #f1f1f1;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: #f9f9f9;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

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

.form-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="black" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.form-col {
    flex: 0 0 100%;
    max-width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

@media (min-width: 768px) {
    .form-col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .form-col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    .form-col-md-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
}

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

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

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

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

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

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

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

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

.btn-info {
    background-color: var(--info-color);
    color: #fff;
}

.btn-info:hover {
    background-color: #16a085;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

/* Alerts */
.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

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

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

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.alert-info {
    background-color: rgba(26, 188, 156, 0.1);
    color: #117a65;
    border-left: 4px solid var(--info-color);
}

/* Filters */
.filter-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.filter-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1.5rem;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    list-style-type: none;
    padding: 0;
    margin-top: 1.5rem;
}

.pagination li {
    margin: 0 0.25rem;
}

.pagination a {
    display: block;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 4px;
}

.pagination a:hover, .pagination a.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content {
        padding: 1rem;
    }
    
    .stats-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 250px;
    }
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    background: none;
    border: none;
    color: var(--dark-color);
    font-size: 1.2rem;
    cursor: pointer;
    margin-right: 1rem;
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #212529;
    color: #f8f9fa;
}

body.dark-mode .header,
body.dark-mode .card,
body.dark-mode .stat-card,
body.dark-mode .filter-container {
    background-color: #343a40;
    color: #f8f9fa;
}

body.dark-mode .card-header,
body.dark-mode .card-footer {
    border-color: #495057;
}

body.dark-mode .table th,
body.dark-mode .table td {
    border-color: #495057;
}

body.dark-mode .table th {
    background-color: #2b3035;
}

body.dark-mode .table tbody tr:hover {
    background-color: #3b4148;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #2b3035;
    border-color: #495057;
    color: #f8f9fa;
}

body.dark-mode .dropdown-menu {
    background-color: #343a40;
}

body.dark-mode .dropdown-item {
    color: #f8f9fa;
    border-color: #495057;
}

body.dark-mode .dropdown-item:hover {
    background-color: #495057;
}

body.dark-mode .dark-mode-toggle,
body.dark-mode .toggle-sidebar,
body.dark-mode .user-btn {
    color: #f8f9fa;
}

/* Loader */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Footer */
.footer {
    padding: 1rem;
    border-top: 1px solid #f1f1f1;
    color: var(--gray-color);
    font-size: 0.9rem;
}

.footer p {
    margin-bottom: 0.5rem;
}

body.dark-mode .footer {
    border-color: #495057;
    color: #adb5bd;
}

/* Print Styles */
@media print {
    .sidebar, 
    .header,
    .footer,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content {
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
} 