/* Root Variables */
:root {
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --navbar-height: 60px;
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --sidebar-bg: #2c3e50;
    --sidebar-text: #ecf0f1;
    --transition: all 0.3s ease;
}

/* Dark theme variables */
[data-theme="dark"] {
    --bs-body-bg: #1a1a1a;
    --bs-body-color: #ffffff;
    --bs-light: #2d3748;
    --bs-secondary: #4a5568;
}

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

body {
    padding-top: var(--navbar-height);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f8f9fa;
    transition: var(--transition);
}

/* Top Navbar Styles */
.navbar {
    height: var(--navbar-height);
    z-index: 1030;
    border-bottom: 1px solid #dee2e6;
}

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

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: var(--sidebar-text);
    transition: var(--transition);
    z-index: 1020;
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.mobile-hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.sidebar-title {
    color: var(--sidebar-text);
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(45deg, #fff, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-text {
    font-size: 16px;
}

.menu-link {
    padding: 10px 16px !important;
}

.sidebar.collapsed .sidebar-title {
    display: none;
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-item {
    margin: 4px 8px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.menu-item.active {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: var(--transition);
    border-radius: 10px;
    overflow: hidden;
}

.menu-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text);
}

.menu-item.active .menu-link {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-right: 3px solid #ffffff;
}

.menu-link i {
    width: 20px;
    text-align: center;
    margin-right: 0.75rem;
    font-size: 1.2rem;
    background: linear-gradient(45deg, #fff, rgba(255, 255, 255, 0.7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.3s ease;
}

.menu-item:hover i {
    transform: scale(1.2) rotate(5deg);
}

.sidebar.collapsed .menu-text {
    display: none;
}

.sidebar.collapsed .menu-link {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar.collapsed .menu-link i {
    margin-right: 0;
}

/* Dropdown Menu Styles */
.has-dropdown .menu-link {
    position: relative;
}

.dropdown-arrow {
    margin-left: auto;
    font-size: 0.9rem;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
    transform-origin: center;
    will-change: transform;
    color: rgba(255, 255, 255, 0.5);
}

.has-dropdown.open .dropdown-arrow {
    transform: rotate(180deg) scale(1.1);
    animation: rotatePop 300ms ease-out both;
    --rot: 180deg;
}

/* Visual icon for dropdown arrow (SVG chevron) */
.dropdown-arrow::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    /* Use current text color so it adapts to themes */
    background-color: currentColor;
    /* Mask the SVG so we can color via background-color */
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>') no-repeat center / contain;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>') no-repeat center / contain;
    opacity: 0.9;
    transition: var(--transition);
}

.menu-link:hover .dropdown-arrow::before {
    opacity: 1;
    transform: scale(1.08);
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    /* Glassmorphism background */
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.has-dropdown.open .submenu {
    max-height: 300px;
}

.submenu-link {
    display: block;
    padding: 10px 16px 10px 48px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.submenu-link:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.submenu-link:hover:before {
    transform: translateX(100%);
}

.submenu-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.sidebar.collapsed .submenu {
    display: none;
}

.sidebar.collapsed .dropdown-arrow {
    display: none;
}

/* Quick Actions Styles */
.quick-action-btn {
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: var(--transition);
    font-weight: 500;
}

.quick-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.quick-action-btn i {
    font-size: 1.5rem;
}

/* Analytics Styles */
.metric-card {
    padding: 1rem;
    border-radius: 8px;
    background: rgba(0, 123, 255, 0.05);
    transition: var(--transition);
}

.metric-card:hover {
    background: rgba(0, 123, 255, 0.1);
    transform: translateY(-2px);
}

.department-item {
    transition: var(--transition);
}

.department-item:hover {
    transform: translateX(5px);
}

/* Enhanced Table Styles */
.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Animated Badges */
.animated-badge {
    transition: var(--transition);
}

.animated-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Action Buttons */
.action-btn {
    transition: var(--transition);
}

.action-btn:hover {
    transform: scale(1.05);
}

/* Two-level dropdown styles */
.has-sub-dropdown {
    position: relative;
}

.has-sub-dropdown .submenu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sub-arrow {
    font-size: 0.8rem;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
    transform-origin: center;
    will-change: transform;
}

.has-sub-dropdown.open .sub-arrow {
    transform: rotate(90deg) scale(1.2);
}

/* Visual icon for sub dropdown arrow (right chevron) */
.sub-arrow::before {
    content: "";
    display: inline-block;
    width: 11px;
    height: 11px;
    background-color: currentColor;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>') no-repeat center / contain;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>') no-repeat center / contain;
    opacity: 0.9;
    transition: var(--transition);
}

.submenu-link:hover .sub-arrow::before {
    opacity: 1;
    transform: scale(1.08);
}

.sub-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    /* Glassmorphism background */
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* Active indicator bars */
.menu-link {
    position: relative;
}

.menu-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 20%;
    width: 0;
    height: 60%;
    background: #ffffff;
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transition: width 0.25s ease, opacity 0.2s ease;
}

.menu-item.active .menu-link::before,
.menu-link:hover::before {
    width: 3px;
    opacity: 1;
}

.submenu-link {
    position: relative;
}

.submenu-link::before {
    content: "";
    position: absolute;
    left: 2.2rem;
    /* aligns inside submenu indent */
    top: 25%;
    width: 0;
    height: 50%;
    background: var(--info-color);
    border-radius: 2px;
    opacity: 0;
    transition: width 0.25s ease, opacity 0.2s ease;
}

.submenu-link.active::before,
.submenu-link:hover::before {
    width: 2px;
    opacity: 1;
}

.has-sub-dropdown.open .sub-submenu {
    max-height: 200px;
}

.sub-submenu-link {
    display: block;
    padding: 0.4rem 1rem 0.4rem 4rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.sub-submenu-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Mobile dropdown adjustments */
@media (max-width: 991.98px) {
    .submenu-link {
        padding-left: 2.5rem;
    }

    .sub-submenu-link {
        padding-left: 3.5rem;
    }
}

/* Glassmorphism for Bootstrap dropdown menus */
.dropdown-menu {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(13, 110, 253, 0.08);
}

/* Bootstrap dropdown toggle caret override to match style */
.dropdown-toggle::after {
    display: inline-block;
    margin-left: .255em;
    vertical-align: .255em;
    content: "";
    width: 10px;
    height: 10px;
    background-color: currentColor;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>') no-repeat center / contain;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>') no-repeat center / contain;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--navbar-height));
    background: rgba(0, 0, 0, 0.5);
    z-index: 1010;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    transition: var(--transition);
    min-height: calc(100vh - var(--navbar-height));
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

.page-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Summary Cards */
.summary-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    height: 100%;
}

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

.summary-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.summary-card h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #e9ecef;
    padding: 1.25rem;
    border-radius: 12px 12px 0 0 !important;
}

.card-header h5 {
    font-weight: 600;
    color: var(--dark-color);
}

/* Timeline Styling */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 25px;
}

.timeline-marker {
    position: absolute;
    left: 10px;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.timeline-content {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}


[data-theme="dark"] .timeline-content {
    padding: 15px;
    background: #1A1A1A;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.timeline-content:hover {
    transform: translateX(5px);
}

.timeline-date {
    display: inline-block;
    padding: 4px 8px;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 8px;
}

/* [data-theme="dark"] .timeline-content h6 {
    color: #4a5568;
} */
[data-theme="dark"] .timeline-content p {
    color: #fff;
}
[data-theme="dark"] .timeline-date {
    display: inline-block;
    padding: 4px 8px;
    background: #4a5568;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 8px;
}

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

.table th {
    border-top: none;
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
}

.table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-top: 1px solid #f1f3f4;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Soft bordered table (used on tables.html) */
.table-bordered-soft {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.table-bordered-soft thead th {
    background-color: #f8f9fb;
    border-top: none;
    border-bottom: 1px solid #eef1f3;
}

.table-bordered-soft td,
.table-bordered-soft th {
    border-right: 1px solid #eef1f3;
}

.table-bordered-soft tr td:last-child,
.table-bordered-soft tr th:last-child {
    border-right: none;
}

.table-bordered-soft tbody tr+tr td {
    border-top: 1px solid #eef1f3;
}

/* Dark theme overrides for soft bordered tables */
[data-theme="dark"] .table-bordered-soft {
    border-radius: 12px;
    background-color: #2d3748;
}

[data-theme="dark"] .table-bordered-soft thead th {
    background-color: #4a5568;
    border-bottom-color: #4a5568;
}

[data-theme="dark"] .table-bordered-soft td,
[data-theme="dark"] .table-bordered-soft th {
    border-right-color: #4a5568;
}

[data-theme="dark"] .table-bordered-soft tr td:last-child,
[data-theme="dark"] .table-bordered-soft tr th:last-child {
    border-right-color: #4a5568;
}

[data-theme="dark"] .table-bordered-soft tbody tr+tr td {
    border-top-color: #4a5568;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-success:hover {
    background-color: #157347;
    border-color: #146c43;
}

.btn-danger:hover {
    background-color: #bb2d3b;
    border-color: #b02a37;
}

/* Birthday List */
.birthday-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f3f4;
}

.birthday-item:last-child {
    border-bottom: none;
}

.birthday-item h6 {
    font-weight: 600;
    color: var(--dark-color);
}
[data-theme="dark"]  .birthday-date {
    border-top-color: #f1f3f4 !important;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }

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

    .sidebar {
        transform: translateX(-100%);
    }

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

    .page-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 767.98px) {
    .main-content {
        padding: 1rem;
    }

    .summary-card h3 {
        font-size: 1.75rem;
    }

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

    .table-responsive {
        font-size: 0.875rem;
    }

    .card-header {
        padding: 1rem;
    }

    .card-body {
        padding: 1rem;
    }
}

/* Dark Theme Styles */
[data-theme="dark"] {
    background-color: #1a1a1a;
    color: #ffffff;
}

[data-theme="dark"] .navbar {
    background-color: #2d3748 !important;
    border-bottom-color: #4a5568;
}

[data-theme="dark"] .card {
    background-color: #2d3748;
    color: #ffffff;
}

[data-theme="dark"] .card-header {
    border-bottom-color: #4a5568;
}

[data-theme="dark"] .table {
    color: #ffffff;
}

[data-theme="dark"] .table td {
    border-top-color: #4a5568;
}

[data-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Dark theme adjustments for glassmorphism */
[data-theme="dark"] .dropdown-menu {
    background: rgba(32, 32, 36, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .submenu {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .sub-submenu {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .page-title {
    color: #ffffff;
}

[data-theme="dark"] .summary-card h3 {
    color: #ffffff;
}

[data-theme="dark"] .card-header h5 {
    color: #ffffff;
}

[data-theme="dark"] .birthday-item h6 {
    color: #ffffff;
}

[data-theme="dark"] .birthday-item {
    border-bottom-color: #4a5568;
}

[data-theme="dark"] body {
    background-color: #1a1a1a;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Micro animation for icon pop */
@keyframes rotatePop {
    0% {
        transform: rotate(0) scale(1);
    }

    60% {
        transform: rotate(var(--rot, 0)) scale(1.12);
    }

    100% {
        transform: rotate(var(--rot, 0)) scale(1.0);
    }
}

.has-dropdown.open .dropdown-arrow {
    animation: rotatePop 300ms ease-out both;
    --rot: 180deg;
}

.has-sub-dropdown.open .sub-arrow {
    animation: rotatePop 300ms ease-out both;
    --rot: 90deg;
}

.summary-card,
.card {
    animation: fadeIn 0.3s ease-out;
}

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

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

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    border-radius: 3px;
}

/* Firefox scrollbar colors */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

/* Focus styles for accessibility */
.btn:focus,
.menu-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.menu-item {
    border-bottom: 2px solid #6077A1;
}

.menu-item.has-dropdown {
    border-bottom: none;
}

/* Print styles */
@media print {

    .sidebar,
    .navbar,
    .btn {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
}