:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --sidebar-bg: #3730a3;
    --sidebar-gradient: linear-gradient(135deg, #3730a3 0%, #4338ca 100%);
    --sidebar-text: #ffffff;
    --sidebar-active-bg: rgba(255, 255, 255, 0.2);
    --sidebar-active-text: #ffffff;
    --top-navbar-bg: #0f172a;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    --card-bg: #ffffff;
    --text-color: #1e293b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

/* Sidebar uses Roboto */
.sidebar,
.sidebar .menu-item,
.sidebar .menu-header,
.sidebar hr,
.top-navbar .brand {
    font-family: 'Roboto', sans-serif;
}

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar-logo-container {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
    padding: 0px 20px 25px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}
.sidebar-logo-container img {
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
    max-width: 100%;
    height: auto;
}
.sidebar-logo-container:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Login Styles */
.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.login-header p {
    color: #6b7280;
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: var(--primary-color);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.btn-login:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-login:active {
    transform: translateY(0);
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    color: #6b7280;
    font-size: 0.8rem;
}

/* Dashboard Adjustments */
body.admin-body {
    background: #f4f6f9;
    display: block;
}

.top-navbar {
    background-color: var(--top-navbar-bg);
    color: white;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1001;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-navbar .brand {
    width: 250px;
    font-size: 1.25rem;
    font-weight: 600;
    background-color: var(--top-navbar-bg);
    color: white;
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 20px;
    margin-left: -20px; 
    transition: all 0.3s ease;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

body.sidebar-toggled .top-navbar .brand {
    width: 0;
    padding-left: 0;
    margin-left: 0;
    opacity: 0;
}

.navbar-left {
    flex: 1;
    padding-left: 20px;
}

.wrapper {
    display: flex;
    margin-top: 56px;
}


.sidebar {
    width: 250px;
    background: var(--sidebar-gradient);
    height: calc(100vh - 56px);
    position: fixed;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    transition: transform 0.3s ease;
}

body.sidebar-toggled .sidebar {
    transform: translateX(-250px);
}

.main-content {
    margin-left: 250px;
    padding: 20px;
    width: calc(100% - 250px);
    transition: margin-left 0.3s ease, width 0.3s ease;
}

body.sidebar-toggled .main-content {
    margin-left: 0;
    width: 100%;
}

#sidebarToggle {
    cursor: pointer;
}

.sidebar-menu {
    padding: 25px 0 10px 0;
}

.menu-header {
    padding: 20px 20px 10px 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
}

.menu-item {
    padding: 12px 20px;
    margin: 4px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.3s;
    border-bottom: none;
}

.menu-item:hover, .menu-item.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    text-decoration: none;
    font-weight: 500;
    backdrop-filter: blur(5px);
    border-left: 3px solid #ffffff;
}

.menu-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar hr {
    margin: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.main-content {
    margin-left: 250px;
    padding: 20px;
    width: calc(100% - 250px);
}

.content-header h1 {
    font-size: 1.75rem;
    margin-bottom: 5px;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    font-size: 0.9rem;
    color: var(--sidebar-text);
}
.breadcrumb-item.active {
    color: var(--primary-color);
    font-weight: 500;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    color: white;
    padding: 0;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.stat-card .info {
    padding: 20px;
}

.stat-card .info h3 {
    font-size: 2rem;
    font-weight: 700;
}

.stat-card .icon {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 3rem;
    opacity: 0.3;
}

.stat-footer {
    background: rgba(0, 0, 0, 0.1);
    color: white;
    text-align: center;
    padding: 5px;
    text-decoration: none;
    font-size: 0.85rem;
    display: block;
    margin-top: auto;
}

.stat-footer:hover {
    background: rgba(0, 0, 0, 0.2);
    color: white;
}

.stat-card.blue { background-color: #6366f1; }
.stat-card.yellow { background-color: #f59e0b; }
.stat-card.green { background-color: #10b981; }
.stat-card.red { background-color: #ef4444; }

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

.chart-container {
    background: white;
    padding: 20px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    height: 350px;
    display: flex;
    flex-direction: column;
}

.chart-container canvas {
    flex: 1;
    width: 100% !important;
    height: 100% !important;
}

.chart-header {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
    padding-bottom: 10px;
    font-weight: 600;
    color: var(--primary-color);
}

/* User Table Enhancements */
.user-img {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.badge-soft-admin {
    background-color: #fee2e2;
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    display: inline-block;
}

.badge-soft-user {
    background-color: #e0e7ff;
    color: #4f46e5;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    display: inline-block;
}

.action-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    text-decoration: none;
    margin: 0 2px;
}

.action-btn-edit {
    background-color: #fef3c7;
    color: #d97706;
}

.action-btn-edit:hover {
    background-color: #d97706;
    color: #fff;
}

.action-btn-delete {
    background-color: #fee2e2;
    color: #ef4444;
}

.action-btn-delete:hover {
    background-color: #ef4444;
    color: #fff;
}

.table-modern {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.table-modern thead th {
    border: none;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table-modern tbody tr {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    border-radius: 8px;
    transition: transform 0.2s;
}

.table-modern tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.table-modern tbody td {
    border: none;
    padding: 1.25rem 1rem;
}

.table-modern tbody td:first-child {
    border-radius: 8px 0 0 8px;
}

.table-modern tbody td:last-child {
    border-radius: 0 8px 8px 0;
}

/* ===== GLOBAL UI COMPONENTS ===== */
.um-page-title { 
    font-size: 1.85rem; 
    font-weight: 700; 
    color: #1e293b; 
    letter-spacing: -0.02em;
}

.uf-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 25px;
    border: 1px solid rgba(0,0,0,0.03);
}

.uf-card-header {
    padding: 20px 25px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.uf-card-body { padding: 25px; }

/* Responsive Sidebar & UI */
@media (max-width: 768px) {
    .um-page-title { font-size: 1.5rem; }
    .uf-card-body { padding: 15px; }
    
    .display-5 {
        font-size: 2.5rem !important;
    }

    .top-navbar .brand {
        width: auto !important;
        max-width: 240px;
        opacity: 1 !important;
        padding-left: 15px !important;
        margin-left: 0 !important;
        font-size: 0.95rem;
        flex-shrink: 1;
    }

    .navbar-left {
        padding-left: 10px;
        margin-right: auto;
        flex-shrink: 0;
    }

    .top-navbar {
        padding: 0 10px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card .info {
        padding: 15px;
    }

    .stat-card .info h3 {
        font-size: 1.5rem;
    }

    .stat-card .info p {
        font-size: 0.8rem;
        margin-bottom: 0;
    }

    .stat-card .icon {
        font-size: 2rem;
        right: 10px;
        top: 10px;
    }

    .stat-footer {
        font-size: 0.75rem;
        padding: 4px;
    }

    .sidebar {
        transform: translateX(-250px);
        z-index: 1002;
    }

    body.sidebar-toggled .sidebar {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Overlay when sidebar is open on mobile */
    body.sidebar-toggled::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1001;
        backdrop-filter: blur(2px);
    }
}


