/* Bootstrap Icons Fix - Prevent oversized icons */
.bi {
    display: inline-block;
    font-size: inherit;
    vertical-align: -0.125em;
}

/* Ensure icons don't overflow their containers */
i[class^="bi-"], i[class*=" bi-"] {
    max-width: 100%;
    max-height: 100%;
}

/* Fix for any stray oversized SVG elements */
svg {
    max-width: 100%;
    height: auto;
}

/* Ensure main content wrapper contains all content properly */
.main-content {
    overflow-x: hidden;
}

/* Color Scheme */
:root {
    --primary-color: #4F46E5;      /* Indigo */
    --secondary-color: #10B981;    /* Green */
    --danger-color: #EF4444;       /* Red */
    --warning-color: #F59E0B;      /* Amber */
    --info-color: #3B82F6;         /* Blue */
    --dark-color: #1F2937;         /* Dark gray */
    --light-bg: #F9FAFB;           /* Light gray background */
    --sidebar-bg: #1E293B;         /* Dark sidebar */
    --sidebar-active: #334155;     /* Active item */
}

/* Layout Styles */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    position: fixed;
    height: 100vh;
    background: var(--sidebar-bg);
    color: white;
    transition: all 0.3s;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.sidebar-footer {
    margin-top: auto;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: 60px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.content-area {
    flex: 1;
    background: var(--light-bg);
    min-height: calc(100vh - 60px);
}

/* Sidebar Menu Styles */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu li a:hover {
    background: var(--sidebar-active);
    color: white;
}

.sidebar-menu li a.active {
    background: var(--sidebar-active);
    color: white;
    border-left: 3px solid var(--primary-color);
}

.sidebar-menu li a i {
    margin-right: 10px;
    font-size: 1.2rem;
    min-width: 24px;
}

/* Sidebar Accordion Styles */
.sidebar-accordion {
    margin: 0;
}

.sidebar-accordion .accordion-toggle {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.sidebar-accordion .accordion-toggle:hover {
    background: var(--sidebar-active);
    color: white;
}

.sidebar-accordion .accordion-toggle.active {
    background: var(--sidebar-active);
    color: white;
}

.sidebar-accordion .accordion-toggle .chevron-icon {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.sidebar-accordion .accordion-toggle[aria-expanded="true"] .chevron-icon,
.sidebar-accordion .accordion-toggle:not(.collapsed) .chevron-icon {
    transform: rotate(180deg);
}

/* Accordion Content (Submenu) */
.sidebar-accordion .accordion-content {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.sidebar-accordion .accordion-content.collapsing {
    transition: height 0.3s ease;
}

.sidebar-accordion .accordion-content li {
    margin: 0;
}

.sidebar-accordion .accordion-content li a {
    display: flex;
    align-items: center;
    padding: 10px 20px 10px 50px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.sidebar-accordion .accordion-content li a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    padding-left: 55px;
}

.sidebar-accordion .accordion-content li a.active {
    background: rgba(79, 70, 229, 0.3);
    color: white;
    border-left: 3px solid var(--primary-color);
    font-weight: 500;
}

.sidebar-accordion .accordion-content li a i {
    margin-right: 10px;
    font-size: 1rem;
    min-width: 20px;
}

/* Stats Cards */
.stats-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stats-card .icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stats-card.primary .icon {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
}

.stats-card.success .icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
}

.stats-card.warning .icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.stats-card.info .icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

/* Auth Page Styles */
.auth-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-wrapper {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Utility Classes */
.badge-role {
    font-size: 0.75rem;
    padding: 4px 8px;
    font-weight: 600;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-lg {
    width: 100px;
    height: 100px;
}

/* Card Styles */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-bottom: 1px solid #e5e7eb;
    background-color: white;
}

/* Button Styles */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #4338ca;
    border-color: #4338ca;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

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

/* Table Styles */
.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #6b7280;
    letter-spacing: 0.05em;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

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

    .sidebar-menu li a span {
        display: inline;
    }
}

/* Overlay for mobile sidebar */
@media (max-width: 768px) {
    .sidebar.show::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

/* Footer */
.footer {
    background: white;
    margin-top: auto;
}

/* Form Controls */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.25);
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 8px;
}

/* Custom Scrollbar */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

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