.admin-container {
    display: flex;
    min-height: calc(100vh - 80px);
    margin-top: 80px;
    position: relative;
}

.admin-sidebar {
    width: 280px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 10;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.profile-info h3 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.profile-info p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

.admin-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-menu li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.admin-menu li a i {
    width: 20px;
    text-align: center;
}

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

.admin-menu li.active a {
    background: rgba(108, 92, 231, 0.2);
    color: white;
}

.admin-menu li.active a::before {
    content: '';
    position: absolute;
    left: 0;
    height: 20px;
    width: 3px;
    background: var(--primary-color);
}

.admin-logout {
    margin-top: auto;
    padding-top: 2rem;
}

.admin-logout button {
    width: 100%;
    padding: 0.8rem;
    background: rgba(214, 48, 49, 0.2);
    border: 1px solid rgba(214, 48, 49, 0.5);
    color: #d63031;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-logout button:hover {
    background: rgba(214, 48, 49, 0.3);
}

.admin-main {
    flex: 1;
    overflow-x: hidden;
    background: rgba(20, 20, 40, 0.8);
    backdrop-filter: blur(5px);
}

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

.admin-header h1 {
    color: white;
    font-size: 1.5rem;
}

.admin-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    width: 300px;
}

.admin-search input {
    background: transparent;
    border: none;
    color: white;
    flex: 1;
    padding: 0.5rem;
}

.admin-search input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.admin-search button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
}

.admin-notifications button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-color);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

.admin-content {
    padding: 2rem;
}

.dashboard-overview {
    margin-bottom: 2rem;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: rgba(26, 26, 46, 0.7);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.chart-container:hover {
    border-color: rgba(108, 92, 231, 0.3);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.chart-container h3 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-container canvas {
    flex: 1;
    width: 100% !important;
    height: 100% !important;
    max-height: 250px;
}

.chart-container.full-width {
    grid-column: 1 / -1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(26, 26, 46, 0.7);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(253, 121, 168, 0.3);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(108, 92, 231, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.stat-info h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.stat-info p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.stat-trend {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
}

.stat-trend.up {
    background: rgba(0, 184, 148, 0.2);
    color: #00b894;
}

.stat-trend.down {
    background: rgba(214, 48, 49, 0.2);
    color: #d63031;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.recent-activity {
    background: rgba(26, 26, 46, 0.7);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.recent-activity h2 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(253, 121, 168, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    font-size: 1rem;
    flex-shrink: 0;
}

.activity-details p {
    color: white;
    margin-bottom: 0.3rem;
}

.activity-time {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.quick-actions {
    background: rgba(26, 26, 46, 0.7);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-actions h2 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn i {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.action-btn span {
    font-size: 0.8rem;
    text-align: center;
}

.action-btn:hover {
    background: rgba(253, 121, 168, 0.2);
    border-color: rgba(253, 121, 168, 0.3);
    transform: translateY(-3px);
}

.admin-section {
    background: rgba(26, 26, 46, 0.7);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    color: white;
    font-size: 1.2rem;
}

.view-all {
    background: transparent;
    border: none;
    color: var(--accent-color);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.view-all:hover {
    text-decoration: underline;
}

.table-container {
    overflow-x: auto;
}

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

.admin-table th {
    background: rgba(108, 92, 231, 0.2);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-table td {
    padding: 1rem;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.table-action {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
}

.table-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.table-action.view {
    color: var(--primary-color);
}

.table-action.edit {
    color: var(--accent-color);
}

@media (max-width: 1200px) {
    .admin-sidebar {
        width: 240px;
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 992px) {
    .admin-sidebar {
        position: fixed;
        left: -280px;
        top: 80px;
        bottom: 0;
        z-index: 100;
    }

    .admin-sidebar.active {
        left: 0;
    }

    .admin-main {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .admin-search {
        width: 100%;
    }

    .admin-content {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .actions-grid {
        grid-template-columns: 1fr 1fr;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.8rem 0.5rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease;
    max-height: 90vh;
    /* Prevent overflow on small screens */
    overflow-y: auto;
    /* Allow scrolling inside modal */
}

/* Scrollbar Styling for Modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-header h2 {
    color: white;
    margin: 0;
    font-size: 1.5rem;
}

.close-modal {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: white;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.8rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-cancel,
.btn-save {
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

.btn-save:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(253, 121, 168, 0.3);
}

/* Toggle Switch Styles for Login/Signup */
.form-toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    padding: 5px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.toggle-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.toggle-btn.active {
    color: white;
    font-weight: 600;
}

.toggle-btn.active::after {
    content: '';
    position: absolute;
    bottom: -11px;
    /* Aligns with container border */
    left: 0;
    width: 100%;
    height: 2px;
    background: #00f2fe;
    box-shadow: 0 0 10px #00f2fe;
}

/* Login Page Specific Layout */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 80px);
    margin-top: 80px;
    padding-top: 0;
}

.login-container .modal-content {
    display: block;
    width: 100%;
    max-width: 400px;
    animation: none;
    margin: 0 auto;
}

.login-button {
    width: 100%;
    margin-top: 1rem;
}

.form-footer {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9em;
    color: #ddd;
}

.form-footer a {
    color: var(--accent-color);
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

.forgot-password-link {
    color: #4facfe;
    font-size: 0.85rem;
    text-decoration: none;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

/* =========================================
   THEME OVERRIDES FOR ADMIN DASHBOARD & LOGIN
   ========================================= */

/* --- Light Mode --- */
body.light-mode .admin-sidebar {
    background: #ffffff;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .profile-info h3,
body.light-mode .profile-info p {
    color: #2d3436;
}

body.light-mode .admin-menu li a {
    color: #636e72;
}

body.light-mode .admin-menu li a:hover,
body.light-mode .admin-menu li.active a {
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary-color);
}

body.light-mode .admin-logout button {
    background: rgba(214, 48, 49, 0.1);
    color: #d63031;
    border-color: rgba(214, 48, 49, 0.2);
}

body.light-mode .admin-main {
    background: #fdfdfd;
}

body.light-mode .admin-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-mode .admin-header h1 {
    color: #2d3436;
}

body.light-mode .admin-search {
    background: #f1f2f6;
    color: #2d3436;
}

body.light-mode .admin-search input {
    color: #2d3436;
}

body.light-mode .admin-search input::placeholder {
    color: #b2bec3;
}

body.light-mode .admin-search button {
    color: #636e72;
}

body.light-mode .admin-notifications button {
    background: rgba(0, 0, 0, 0.05);
    color: #2d3436;
}

body.light-mode .stat-card,
body.light-mode .chart-container,
body.light-mode .recent-activity,
body.light-mode .quick-actions,
body.light-mode .admin-section {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

body.light-mode .chart-container h3,
body.light-mode .stat-info h3,
body.light-mode .recent-activity h2,
body.light-mode .quick-actions h2,
body.light-mode .section-header h2 {
    color: #2d3436;
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

body.light-mode .stat-info p,
body.light-mode .activity-details p {
    color: #636e72;
}

body.light-mode .activity-item:hover {
    background: #f8f9fa;
}

body.light-mode .activity-time {
    color: #b2bec3;
}

body.light-mode .action-btn {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: #2d3436;
}

body.light-mode .action-btn:hover {
    background: #f8f9fa;
}

body.light-mode .admin-table th {
    background: #f1f2f6;
    color: #2d3436;
}

body.light-mode .admin-table td {
    color: #2d3436;
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

body.light-mode .admin-table tr:hover td {
    background: #f8f9fa;
    color: #2d3436;
}

body.light-mode .table-action {
    color: #b2bec3;
}

body.light-mode .table-action:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #2d3436;
}

/* Light Mode Admin Login */
body.light-mode .admin-login-container,
body.light-mode .login-container .modal-content {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

body.light-mode .admin-login-title,
body.light-mode .form-group label,
body.light-mode .toggle-btn {
    color: #2d3436;
}

body.light-mode .toggle-btn:hover {
    color: var(--primary-color);
}

body.light-mode .toggle-btn.active {
    color: var(--primary-color);
}

body.light-mode .form-group input {
    background: #fdfdfd;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #2d3436;
}

body.light-mode .form-footer {
    color: #636e72;
}

/* Light Mode Modals */
body.light-mode .modal-content {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #2d3436;
}

body.light-mode .modal-header h2 {
    color: #2d3436;
}

body.light-mode .close-modal {
    color: #b2bec3;
}

body.light-mode .close-modal:hover {
    color: #2d3436;
}

body.light-mode .btn-cancel {
    background: #f1f2f6;
    color: #2d3436;
}

body.light-mode .btn-cancel:hover {
    background: #dfe6e9;
}


/* --- OLED Mode --- */
body.oled-mode .admin-sidebar {
    background: #000000;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

body.oled-mode .admin-main {
    background: #000000;
}

body.oled-mode .admin-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

body.oled-mode .admin-search {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

body.oled-mode .admin-notifications button {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

body.oled-mode .stat-card,
body.oled-mode .chart-container,
body.oled-mode .recent-activity,
body.oled-mode .quick-actions,
body.oled-mode .admin-section {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: none;
}

body.oled-mode .admin-table th {
    background: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

body.oled-mode .admin-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.oled-mode .admin-table tr:hover td {
    background: #111;
}

body.oled-mode .action-btn {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

body.oled-mode .admin-login-container,
body.oled-mode .modal-content,
body.oled-mode .login-container .modal-content {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

body.oled-mode .form-group input {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}