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

html, body {
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fa;
    color: #2c3e50;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #2c3e50;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

/* Navbar Custom Styles */
.navbar {
    background: linear-gradient(135deg, #E5C51A 0%, #d4b016 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 600;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem;
    margin: 0 0.25rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    margin-top: 0;
    flex: 1;
}

.main-content-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: transparent;
    width: 100%;
    margin: 0;
    padding: 0;
}

.main-content-auth .container-fluid {
    background: transparent;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Cards */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.card-header {
    background: linear-gradient(135deg, #E5C51A 0%, #d4b016 100%);
    color: white;
    border-radius: 1rem 1rem 0 0 !important;
    font-weight: 600;
    padding: 1rem 1.5rem;
    border: none;
}

.card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 0.5rem;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #E5C51A 0%, #d4b016 100%);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #c7a014 0%, #a68a10 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(229, 197, 26, 0.3);
}

.btn-outline-primary {
    border: 2px solid #E5C51A;
    color: #E5C51A;
}

.btn-outline-primary:hover {
    background: #E5C51A;
    transform: translateY(-2px);
}

/* Forms */
.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border: 2px solid #e0e0e0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.form-control:focus,
.form-select:focus {
    border-color: #E5C51A;
    box-shadow: 0 0 0 0.2rem rgba(229, 197, 26, 0.15);
}

.form-check-input:checked {
    background-color: #E5C51A;
    border-color: #E5C51A;
}

/* Tables */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
    background: white;
}

.table thead {
    background: linear-gradient(135deg, #E5C51A 0%, #d4b016 100%);
    color: white;
}

.table thead th {
    border: none;
    font-weight: 600;
    padding: 1rem;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
}

/* Badge */
.badge {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 0.5rem;
}

/* Alert */
.alert {
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 1rem 1.5rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Login Container */
.login-container {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

/* Login Card */
.login-card {
    max-width: 450px;
    width: 100%;
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    background: linear-gradient(135deg, #E5C51A 0%, #d4b016 100%);
    color: white;
    padding: 2rem;
    border-radius: 1.5rem 1.5rem 0 0;
    text-align: center;
}

.login-header i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.login-body {
    padding: 2rem;
}

/* Dashboard Stats */
.stats-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
}

.stats-icon.primary {
    background: linear-gradient(135deg, #E5C51A 0%, #d4b016 100%);
}

.stats-icon.success {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
}

.stats-icon.warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffb800 100%);
}

.stats-icon.danger {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
}

.stats-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0.5rem 0;
}

.stats-label {
    color: #6c757d;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Utilities */
.shadow-sm {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.rounded-lg {
    border-radius: 1rem !important;
}

.text-primary {
    color: #E5C51A !important;
}

.bg-primary {
    background: linear-gradient(135deg, #E5C51A 0%, #d4b016 100%) !important;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* ==================== SIDEBAR STYLES ==================== */
.sidebar-nav {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    background: white;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.sidebar-nav.collapsed {
    width: 80px;
}

.sidebar-brand {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-brand i {
    font-size: 2rem;
    color: #E5C51A;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
}

.sidebar-nav.collapsed .brand-text {
    display: none;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    padding: 1.5rem 0;
    margin: 0;
}

.menu-section {
    margin-bottom: 2rem;
}

.menu-label {
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 1.5rem;
    margin-bottom: 0.75rem;
}

.sidebar-nav.collapsed .menu-label {
    display: none;
}

.menu-items {
    list-style: none;
    padding: 0;
}

.menu-item {
    position: relative;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #495057;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.menu-link i:first-child {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    width: 24px;
}

.menu-link:hover {
    background-color: #f8f9fa;
    color: #E5C51A;
}

.menu-item.active .menu-link {
    background-color: #e7f1ff;
    color: #E5C51A;
    border-left-color: #E5C51A;
    font-weight: 600;
}

.has-submenu .menu-link i:last-child {
    margin-left: auto;
    font-size: 0.875rem;
}

.submenu {
    list-style: none;
    padding: 0;
    background-color: #f8f9fa;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.menu-item.open .submenu {
    max-height: 300px;
}

.submenu-link {
    display: block;
    padding: 0.5rem 1.5rem 0.5rem 4rem;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.submenu-link:hover {
    background-color: #e9ecef;
    color: #E5C51A;
}

.sidebar-nav.collapsed .menu-link span,
.sidebar-nav.collapsed .submenu {
    display: none;
}

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

.upgrade-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 1.5rem;
    color: white;
    text-align: center;
}

.upgrade-banner h6 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upgrade-banner p {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.sidebar-nav.collapsed .sidebar-footer {
    display: none;
}

/* ==================== TOPBAR STYLES ==================== */
.topbar {
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    height: 70px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.sidebar-nav.collapsed ~ .topbar {
    left: 80px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-menu-toggle:hover {
    color: #E5C51A;
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-actions {
    display: flex;
    gap: 0.5rem;
}

.action-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f8f9fa;
    color: #6c757d;
    text-decoration: none;
    transition: all 0.3s ease;
}

.action-icon:hover {
    background: #e9ecef;
    color: #E5C51A;
}

.badge-sm {
    font-size: 0.625rem;
    padding: 2px 6px;
}

.topbar-user .btn-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    padding: 0.5rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #E5C51A, #d4b016);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.user-name {
    font-weight: 500;
    color: #2c3e50;
}

/* Adjust main content for sidebar */
body:has(.sidebar-nav) .main-content {
    margin-left: 280px;
    padding-top: 70px;
}

body:has(.sidebar-nav.collapsed) .main-content {
    margin-left: 80px;
}

@media (max-width: 768px) {
    .sidebar-nav {
        transform: translateX(-100%);
    }
    
    body .main-content {
        margin-left: 0 !important;
        padding-top: 70px;
    }
    
    .topbar {
        left: 0 !important;
    }
}
