/* Modern Admin Redesign - Glassmorphism & Animations */
:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #f3f4f6;
    --surface: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --sidebar-bg: #111827;
    --sidebar-text: #e5e7eb;
    --border-radius: 16px;
    --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Inter', sans-serif !important;
    background-color: var(--bg-color) !important;
    color: var(--text-main);
    letter-spacing: -0.015em;
}

/* Navbar */
.navbar-bg {
    background: #ffffff !important;
    height: 110px !important; /* Increased height */
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: var(--shadow-soft);
    animation: fadeInDown 0.6s ease-out;
}
.main-navbar {
    top: 15px; /* Adjusted to center nicely within the taller header */
}
.navbar .nav-link {
    color: var(--text-main) !important;
    font-weight: 500;
}
.search-element .form-control {
    border-radius: 30px !important;
    padding-left: 20px;
    border: 1px solid #e5e7eb !important;
    background: #f9fafb !important;
    color: var(--text-main) !important;
    transition: all 0.3s ease;
    min-width: 450px !important; /* Make search bar wider just in case */
}
.search-element .form-control::placeholder {
    color: var(--text-muted);
}
.search-element .form-control:focus {
    background: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.search-element .btn {
    color: var(--text-muted) !important;
}

/* Sidebar */
.main-sidebar {
    background: var(--sidebar-bg) !important;
    box-shadow: var(--shadow-soft) !important;
    border-right: 1px solid rgba(255,255,255,0.05);
    animation: slideInLeft 0.5s ease-out;
}
.sidebar-brand {
    padding-top: 15px;
    padding-left: 10px;
}
/* --- Sidebar Typography & Base Colors --- */
.main-sidebar .sidebar-menu li,
.main-sidebar .sidebar-menu li a,
.main-sidebar .sidebar-menu li a.nav-link,
.main-sidebar .sidebar-menu li a.has-dropdown,
.main-sidebar .sidebar-menu li a span,
.main-sidebar .sidebar-menu .dropdown-menu li,
.main-sidebar .sidebar-menu .dropdown-menu li a {
    color: var(--sidebar-text) !important;
    background-color: transparent !important;
    font-weight: 500;
    text-decoration: none !important;
}

/* Icon Colors ONLY (Never override font-weight so FontAwesome doesn't break) */
.main-sidebar .sidebar-menu li a i,
.main-sidebar .sidebar-menu li a em {
    color: var(--sidebar-text) !important;
    opacity: 1 !important;
    margin-right: 15px !important;
    text-align: center;
    width: 20px; /* Consistent icon width */
}

/* --- Sidebar Layout (Flexbox) --- */
.main-sidebar .sidebar-menu li > a {
    display: flex !important;
    align-items: center !important;
    text-align: left !important;
    width: calc(100% - 30px) !important; /* 100% minus 15px margin on each side */
    margin: 4px 15px !important;
    padding: 12px 15px !important;
    border-radius: 8px !important;
    background-color: transparent !important;
    box-sizing: border-box !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative !important;
    height: auto !important;
    line-height: 1.3 !important;
}

/* Allow text to take remaining space */
.main-sidebar .sidebar-menu li a span {
    flex-grow: 1 !important;
    white-space: normal !important; 
}

/* Submenu Layout */
.main-sidebar .sidebar-menu .dropdown-menu {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}
.main-sidebar .sidebar-menu .dropdown-menu li > a {
    padding: 10px 15px 10px 45px !important; /* Indent submenus */
    margin: 2px 15px !important;
    width: calc(100% - 30px) !important;
    display: block !important; /* Keep submenu as block unless they have icons */
    text-align: left !important;
    background-color: transparent !important;
}

/* Remove awkward Stisla left border/block */
.main-sidebar .sidebar-menu > li > a::before,
.main-sidebar .sidebar-menu > li.active > a::before,
body:not(.sidebar-mini) .sidebar-style-2 .sidebar-menu > li.active > a::before {
    display: none !important;
    content: none !important;
    border: none !important;
    width: 0 !important;
}

/* --- Hover & Active States --- */
.main-sidebar .sidebar-menu li a:hover,
.main-sidebar .sidebar-menu li a.has-dropdown:hover,
.main-sidebar .sidebar-menu .dropdown-menu li a:hover {
    background: rgba(255,255,255,0.1) !important;
    transform: translateX(5px);
    color: #fff !important;
}

.main-sidebar .sidebar-menu li.active > a,
.main-sidebar .sidebar-menu li.active > a.has-dropdown {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4) !important;
}

/* Fix text and icon colors for hover/active states */
.main-sidebar .sidebar-menu li a:hover span,
.main-sidebar .sidebar-menu li a:hover i,
.main-sidebar .sidebar-menu li a:hover em,
.main-sidebar .sidebar-menu li.active > a span,
.main-sidebar .sidebar-menu li.active > a i,
.main-sidebar .sidebar-menu li.active > a em {
    color: #fff !important;
}
.sidebar-brand a {
    color: #fff !important;
    letter-spacing: 1px;
    font-weight: 700;
}

/* Cards */
.card {
    border-radius: var(--border-radius) !important;
    border: none !important;
    box-shadow: var(--shadow-soft) !important;
    background: var(--surface) !important;
    transition: all 0.3s ease;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover) !important;
}
.card-header {
    border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    background: transparent !important;
    padding-top: 20px;
    padding-bottom: 20px;
}
.card-header h4 {
    color: var(--text-main) !important;
    font-weight: 600 !important;
}
.card-statistic-1 {
    display: flex;
    align-items: center;
    padding: 20px;
}
.card-statistic-1 .card-icon {
    width: 70px !important;
    height: 70px !important;
    border-radius: 20px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px !important;
    color: #fff;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
.card-statistic-1:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}
.card-statistic-1 .card-wrap {
    padding-left: 20px;
}
.card-statistic-1 .card-header h4 {
    font-size: 14px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted) !important;
}
.card-statistic-1 .card-body {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: var(--text-main);
}

/* Gradient Backgrounds for Icons */
.bg-primary { background: linear-gradient(135deg, #6366f1, #a855f7) !important; }
.bg-danger { background: linear-gradient(135deg, #ef4444, #f43f5e) !important; }
.bg-warning { background: linear-gradient(135deg, #f59e0b, #fbbf24) !important; }
.bg-success { background: linear-gradient(135deg, #10b981, #34d399) !important; }

/* Buttons */
.btn {
    border-radius: 8px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #8b5cf6) !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3) !important;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.4) !important;
}

/* Inputs */
.form-control {
    border-radius: 8px !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    padding: 10px 15px;
    transition: all 0.3s ease;
}
.form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translate3d(0, 30px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translate3d(0, -30px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translate3d(-30px, 0, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Adjust main content background */
.main-content {
    padding-top: 110px !important;
}
