* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2E3B8E;
    --secondary-color: #FFA500;
    --sidebar-width: 270px;
    --header-height: 70px;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f5f6fa;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
}

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--primary-color);
    color: var(--white);
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

.logo i {
    font-size: 2rem;
    color: var(--secondary-color);
}

.logo-text {
    line-height: 1.3;
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu ul li {
    margin: 5px 0;
}

.sidebar-menu ul li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 25px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    position: relative;
}

.sidebar-menu ul li a i {
    font-size: 1.2rem;
    width: 25px;
}

.sidebar-menu ul li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    padding-left: 30px;
}

.sidebar-menu ul li.active a {
    background: var(--secondary-color);
    color: var(--white);
    border-left: 4px solid var(--white);
}

/* Sidebar Toggle States */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .sidebar-menu ul li a span {
    display: none;
}

.sidebar.collapsed .sidebar-menu ul li a {
    justify-content: center;
    padding: 14px 0;
}

/* ========== TOP HEADER ========== */
.top-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: var(--shadow);
    z-index: 999;
    transition: all 0.3s ease;
}

.sidebar.collapsed~.top-header {
    left: 80px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.breadcrumb i {
    color: var(--secondary-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.current-date,
.current-time {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
}

.current-date i,
.current-time i {
    color: var(--secondary-color);
}

.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--secondary-color);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.user-info i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.user-profile:hover .user-info i {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 15px;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-profile .dropdown-menu {
    display: block !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
}

.user-profile:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--white);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.dropdown-menu a:first-child {
    border-radius: 10px 10px 0 0;
}

.dropdown-menu a:last-child {
    border-radius: 0 0 10px 10px;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
    padding-left: 25px;
}

.dropdown-menu a i {
    color: var(--primary-color);
    width: 20px;
}

.dropdown-menu hr {
    margin: 0;
    border: none;
    border-top: 1px solid #e0e0e0;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 30px;
    min-height: calc(100vh - var(--header-height));
    transition: all 0.3s ease;
}

.sidebar.collapsed~.top-header~.main-content {
    margin-left: 80px;
}

/* ========== DASHBOARD CARDS ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.dashboard-card {
    background: var(--white);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--card-color, #3498db);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 20px;
    background: var(--card-bg, rgba(52, 152, 219, 0.1));
    color: var(--card-color, #3498db);
}

.card-content h3 {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 10px;
}

.card-content .number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--card-color, #3498db);
    color: var(--white);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Card Color Variations */
.dashboard-card.red {
    --card-color: #e74c3c;
    --card-bg: rgba(231, 76, 60, 0.1);
}

.dashboard-card.pink {
    --card-color: #e91e63;
    --card-bg: rgba(233, 30, 99, 0.1);
}

.dashboard-card.purple {
    --card-color: #9b59b6;
    --card-bg: rgba(155, 89, 182, 0.1);
}

.dashboard-card.blue {
    --card-color: #3498db;
    --card-bg: rgba(52, 152, 219, 0.1);
}

.dashboard-card.cyan {
    --card-color: #00bcd4;
    --card-bg: rgba(0, 188, 212, 0.1);
}

.dashboard-card.teal {
    --card-color: #009688;
    --card-bg: rgba(0, 150, 136, 0.1);
}

.dashboard-card.green {
    --card-color: #27ae60;
    --card-bg: rgba(39, 174, 96, 0.1);
}

.dashboard-card.yellow {
    --card-color: #f39c12;
    --card-bg: rgba(243, 156, 18, 0.1);
}

.dashboard-card.orange {
    --card-color: #e67e22;
    --card-bg: rgba(230, 126, 34, 0.1);
}

.dashboard-card.brown {
    --card-color: #795548;
    --card-bg: rgba(121, 85, 72, 0.1);
}

/* ========== FOOTER ========== */
.footer {
    background: var(--white);
    padding: 20px 30px;
    margin-left: var(--sidebar-width);
    margin-top: 50px;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.sidebar.collapsed~.top-header~.main-content~.footer {
    margin-left: 80px;
}

.footer-content p {
    margin: 5px 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ========== LOGIN PAGE ========== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--primary-color);
    padding: 2rem;
}

.login-box {
    background: var(--white);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 450px;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.login-header h2 {
    color: var(--text-dark);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-light);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: 'Poppins', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Poppins', sans-serif;
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-danger {
    background: #fee;
    border-left: 4px solid #e74c3c;
    color: #c0392b;
}

.alert-success {
    background: #efe;
    border-left: 4px solid #27ae60;
    color: #1e8449;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .top-header {
        left: 0 !important;
    }

    .main-content,
    .footer {
        margin-left: 0 !important;
    }

    .header-right .current-date,
    .header-right .current-time {
        display: none;
    }

    .breadcrumb span {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .user-name {
        display: none;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 15px;
    }

    .top-header {
        padding: 0 15px;
    }

    .login-box {
        padding: 2rem;
    }
}