/* -------------------- assets/css/style.css -------------------- */
/* Updated with fixed login alignment */

:root {
    --primary: #1a4d8f;
    --primary-light: #2a6fb5;
    --primary-dark: #0d2f5a;
    --secondary: #e8b82e;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --dark: #1a1a2e;
    --gray: #6c757d;
    --light-gray: #f4f6f9;
    --white: #ffffff;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --shadow: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--light-gray);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--primary-dark);
    color: var(--white);
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 2px 0 15px rgba(0,0,0,0.2);
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 10px;
}

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

.sidebar-brand .sidebar-logo {
    justify-content: center;
	}
.sidebar-brand a {
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 800;
    width: 100%;
}

.logo-container {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sidebar-logo {
    width: 100px;
    height: 50px;
    object-fit: contain;
    flex-shrink: 0;
    /* Remove any background */
    background: transparent !important;
    /* Remove any border */
    border: none !important;
    /* Remove any shadow */
    box-shadow: none !important;
    /* Ensure transparency */
    background-color: transparent !important;
}

.sidebar-brand i {
    color: var(--secondary);
    font-size: 2rem;
}

.sidebar-brand .brand-text {
    white-space: nowrap;
    font-size: 1rem;
}

.sidebar-user {
    padding: 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--dark);
    flex-shrink: 0;
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role {
    font-size: 0.75rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    padding: 0.5rem 0;
}

.sidebar-nav .nav-section {
    padding: 0.8rem 1.2rem 0.3rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    font-weight: 600;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0.7rem 1.2rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    font-size: 0.9rem;
    position: relative;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.08);
    color: var(--white);
    border-left-color: var(--secondary);
}

.sidebar-nav a.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border-left-color: var(--secondary);
}

.sidebar-nav a i {
    width: 22px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-nav a .nav-label {
    flex: 1;
    white-space: nowrap;
}

.sidebar-nav a .badge-nav {
    background: var(--danger);
    color: var(--white);
    font-size: 0.65rem;
    padding: 0.15rem 0.6rem;
    border-radius: 50px;
    font-weight: 600;
}

.sidebar-nav a.logout-link {
    margin-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    color: rgba(255,255,255,0.6);
}

.sidebar-nav a.logout-link:hover {
    color: var(--danger);
    border-left-color: var(--danger);
}

/* Sidebar Toggle */
.sidebar-toggle {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1001;
    background: var(--primary-dark);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--primary);
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

/* When sidebar is hidden (login pages) */
.main-content.no-sidebar {
    margin-left: 0;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.content-wrapper {
    padding: 2rem 2rem 1rem;
    flex: 1;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
}

/* ===== TOP HEADER ===== */
.top-header {
    background: var(--white);
    padding: 1rem 2rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.top-header .page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.top-header .page-title small {
    font-size: 0.85rem;
    color: var(--gray);
    display: block;
    font-weight: 400;
}

.top-header .header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.top-header .header-actions .notification-bell {
    position: relative;
    font-size: 1.2rem;
    color: var(--gray);
    cursor: pointer;
}

.top-header .header-actions .notification-bell .badge-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--white);
    padding: 1rem 2rem;
    border-top: 1px solid #e9ecef;
    text-align: center;
    color: var(--gray);
    font-size: 0.85rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ===== AUTH CONTAINER (Login Pages) ===== */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    width: 100%;
    padding: 2rem;
}

.auth-container {
    max-width: 480px;
    width: 100%;
    padding: 2.5rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 0 auto;
}

.auth-container .auth-logo {
    text-align: center;
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    font-weight: 700;
}

.auth-container .auth-subtitle {
    text-align: center;
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ===== CARDS & CONTAINERS ===== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--light-gray);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
}

/* ===== DASHBOARD STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-card .stat-icon {
    font-size: 1.8rem;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
}

.stat-card .stat-number {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-dark);
}

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

.stat-card.green { border-left-color: var(--success); }
.stat-card.gold { border-left-color: var(--secondary); }
.stat-card.red { border-left-color: var(--danger); }
.stat-card.blue { border-left-color: var(--info); }

/* ===== TABLES ===== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

table thead {
    background: var(--primary-dark);
    color: var(--white);
}

table th {
    padding: 0.8rem 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

table tbody tr:hover {
    background: rgba(26, 77, 143, 0.04);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--dark);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--white);
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 77, 143, 0.2);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 77, 143, 0.4);
}

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

.btn-success:hover {
    background: #218838;
}

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

.btn-danger:hover {
    background: #c82333;
}

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

.btn-warning:hover {
    background: #e0a800;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

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

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-primary { background: #cce5ff; color: #004085; }
.badge-secondary { background: #e9ecef; color: #6c757d; }

/* ===== ALERTS ===== */
.alert {
    padding: 1rem 1.2rem;
    border-radius: var(--radius);
    margin-bottom: 1.2rem;
    font-weight: 500;
}

.alert-success { background: #d4edda; color: #155724; border-left: 4px solid var(--success); }
.alert-danger { background: #f8d7da; color: #721c24; border-left: 4px solid var(--danger); }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid var(--warning); }
.alert-info { background: #d1ecf1; color: #0c5460; border-left: 4px solid var(--info); }

/* ===== LOGIN PREFIX ===== */
.login-prefix {
    position: relative;
}

.login-prefix .prefix-text {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-weight: 600;
    font-size: 0.95rem;
    pointer-events: none;
    background: #f8f9fa;
    padding: 0 8px;
    border-radius: 4px;
}

.login-prefix .form-control {
    padding-left: 70px;
}

/* ===== ROLE SELECTOR ===== */
.role-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.role-option {
    padding: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-option:hover {
    border-color: #1a4d8f;
    background: #f8f9fa;
}

.role-option.active {
    border-color: #1a4d8f;
    background: #e8f0fe;
}

.role-option input[type="radio"] {
    display: none;
}

.role-option .role-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.3rem;
}

.role-option .role-label {
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===== CHARTS ===== */
.chart-container {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    position: relative;
    height: 300px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }
    
    .sidebar-brand .brand-text,
    .sidebar-nav a .nav-label,
    .sidebar-user .user-info,
    .sidebar-nav .nav-section {
        display: none;
    }
    
    .sidebar-brand {
        justify-content: center;
        padding: 0.8rem;
    }
	.sidebar-brand a {
        justify-content: center;
    }
	
	.sidebar-logo {
        width: 30px;
        height: 30px;
    }
	
    .logo-container {
        width: 35px;
        height: 35px;
    }
    
    .sidebar-user {
        justify-content: center;
        padding: 1rem;
    }
    
    .sidebar-nav a {
        justify-content: center;
        padding: 0.8rem;
    }
    
    .sidebar-nav a i {
        font-size: 1.3rem;
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed);
    }
    
    .sidebar:hover {
        width: var(--sidebar-width);
    }
    
    .sidebar:hover .sidebar-brand .brand-text,
    .sidebar:hover .sidebar-nav a .nav-label,
    .sidebar:hover .sidebar-user .user-info,
    .sidebar:hover .sidebar-nav .nav-section {
        display: block;
    }
    
    .sidebar:hover .sidebar-brand {
        justify-content: flex-start;
        padding: 1rem 1.2rem;
    }
	.sidebar:hover .sidebar-brand a {
        justify-content: flex-start;
    }
	 .sidebar:hover .sidebar-logo {
        width: 32px;
        height: 32px;
    }
    
    .sidebar:hover .sidebar-user {
        justify-content: flex-start;
        padding: 1.2rem;
    }
    
    .sidebar:hover .sidebar-nav a {
        justify-content: flex-start;
        padding: 0.7rem 1.2rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .sidebar-toggle {
        display: block;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1001;
        background: var(--primary-dark);
        color: var(--white);
        border: none;
        border-radius: 8px;
        padding: 8px 12px;
        font-size: 1.2rem;
        cursor: pointer;
    }
    
    .main-content {
        margin-left: 0;
        padding-top: 60px; /* Add padding to push content down below toggle button */
    }
    
    /* Add left padding to content when sidebar is closed */
    .content-wrapper {
        padding: 1rem 1rem 1rem 3.5rem; /* Add left padding to avoid toggle button overlap */
    }
    
    /* When sidebar is open, adjust content padding */
    .sidebar.open ~ .main-content .content-wrapper {
        padding-left: 1rem; /* Reset padding when sidebar is open */
    }
    
    .top-header {
        padding: 0.8rem 1rem 0.8rem 3.5rem; /* Add left padding to header */
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .top-header .page-title h1 {
        font-size: 1.2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card .stat-number {
        font-size: 1.5rem;
    }
    
    .auth-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .auth-wrapper {
        padding: 1rem;
    }
    
    .sidebar-brand .brand-text,
    .sidebar-nav a .nav-label,
    .sidebar-user .user-info,
    .sidebar-nav .nav-section {
        display: block;
    }
    
    .sidebar-brand {
        justify-content: flex-start;
        padding: 1rem 1.2rem;
    }
    
    .sidebar-logo {
        width: 30px;
        height: 30px;
    }
    
    .sidebar-brand a {
        justify-content: flex-start;
    }
    .logo-container {
        width: 40px;
        height: 40px;
    }
    
    .sidebar-user {
        justify-content: flex-start;
        padding: 1.2rem;
    }
    
    .sidebar-nav a {
        justify-content: flex-start;
        padding: 0.7rem 1.2rem;
    }
    
    .role-selector {
        grid-template-columns: 1fr;
    }
    
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card .stat-number {
        font-size: 1.2rem;
    }
    
	.sidebar-logo {
        width: 26px;
        height: 26px;
    }
	
    .card {
        padding: 1rem;
    }
    
    table th,
    table td {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .auth-container {
        padding: 1.2rem;
    }
}

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.text-muted { color: var(--gray); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 2rem; }
.flex { display: flex; align-items: center; gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.w-100 { width: 100%; }
.d-block { display: block; }

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}