/* Main Stylesheet */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background: #f8f9fa;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    color: white;
    top: 0;
    bottom: 0;
    height: auto;
    max-height: none;
    padding: 0;
    position: fixed;
    width: 280px;
    left: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) rgba(255,255,255,0.1);
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 8px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
}

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

.sidebar-header {
    padding: 0 20px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.sidebar-header h4 {
    margin: 0;
    font-weight: 700;
    font-size: 1.5rem;
}

.sidebar-header p {
    margin: 5px 0 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

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

.sidebar-menu li {
    margin-bottom: 0;
}

.sidebar-menu a {
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    padding: 12px 25px;
    display: block;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left-color: white;
    padding-left: 22px;
}

.sidebar-menu i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
}

.sidebar-menu li.sidebar-header {
    margin: 0;
    cursor: pointer;
    padding: 0;
}

.sidebar-menu li.sidebar-header:hover {
    background: rgba(255,255,255,0.1);
}

.sidebar-menu li.sidebar-header span {
    padding: 12px 25px;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 1 !important;
}

.sidebar-menu li.sidebar-header span i {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    margin-right: 10px;
    margin-left: 0;
    width: auto;
}

.sidebar-menu li.sidebar-header span i.fa-chevron-down {
    transform: rotate(90deg);
}

.sidebar-menu li.sidebar-header span i.fa-chevron-right {
    transform: rotate(0deg);
}

.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0,0,0,0.2);
    overflow: hidden;
}

.sidebar-submenu li {
    margin: 0;
}

.sidebar-submenu li a {
    padding: 10px 25px 10px 40px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.95);
    border-left: 3px solid transparent;
}

.sidebar-submenu li a:hover {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left-color: rgba(255,255,255,0.6);
    padding-left: 38px;
}

.sidebar-submenu li a.active {
    background: rgba(255,255,255,0.2);
    color: white;
    border-left-color: white;
    font-weight: 600;
}

/* Disabled Links */
.sidebar-menu a.disabled {
    color: rgba(255,255,255,0.4) !important;
    cursor: pointer !important;
    opacity: 0.6;
    position: relative;
}

.sidebar-menu a.disabled:hover {
    background: rgba(255,255,255,0.1) !important;
    color: rgba(255,255,255,0.6) !important;
    border-left-color: rgba(255,255,255,0.3) !important;
    padding-left: 22px !important;
}

.sidebar-menu a.disabled::after {
    content: "🚧";
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    opacity: 0.5;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 20px 0;
}

 /* Main Content */
 .main-content {
     margin-left: 280px;
     padding: 30px;
 }

 /* Pages use Bootstrap grid for <main>; override to fill space beside fixed sidebar */
 .sidebar + main {
     margin-left: 280px !important;
     width: calc(100% - 280px) !important;
     max-width: none !important;
     flex: 0 0 auto !important;
 }

 /* Bootstrap's ms-sm-auto adds margin-left:auto; neutralize it for our layout */
 .sidebar + main.ms-sm-auto {
     margin-left: 280px !important;
     margin-right: 0 !important;
 }

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    border-radius: 10px 10px 0 0;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

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

.table-hover tbody tr:hover {
    background: #f8f9fa;
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* Modals */
.modal-content {
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.modal-title {
    font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        min-height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }

    .sidebar + main {
        margin-left: 0 !important;
        width: 100% !important;
    }
}