.nested-content table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

.nested-content td {
    padding: 8px;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Column widths for nested content */
.nested-content td:first-child {
    width: 100% !important;
}

.nested-content td:nth-child(2),
.nested-content td:nth-child(3),
.nested-content td:nth-child(4),
.nested-content td:nth-child(5) {
    width: 10% !important;
    text-align: right !important;
}

/* Ensure consistent alignment for all numeric columns */
.nested-content td[style*="text-align: right"] {
    text-align: right !important;
    padding-right: 15px !important;
}

/* Ensure consistent cell content */
.nested-content td {
    font-size: 14px !important;
    border: 1px solid #dee2e6 !important;
}

.hierarchy-row td,
.nested-content td {
    padding: 8px;
    vertical-align: middle;
}

/* Main container for hierarchy */
.hierarchy-container {
    margin: 20px auto;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

/* Color indicators */
.green-color {
    color: green;
    font-weight: bold;
}

.red-color {
    color: red;
    font-weight: bold;
}

.orge-color {
    color: #ffbc00;
    font-weight: bold;
}

.blue-color {
    color: #007bff;
    font-weight: bold;
}

/* Table styles */
.table-bordered th,
.table-bordered td {
    vertical-align: middle !important;
    text-align: left;
    font-size: 14px;
    padding: 8px 14px;
}

.table-bordered th.text-right,
.table-bordered td.text-right {
    text-align: right;
}

/* Table header styling */
thead.bg-light th {
    background-color: #f1f1f1;
    font-weight: bold;
    font-size: 13px;
    text-align: center;
}

/* Card and header styling */
.card-header {
    font-size: 16px;
    font-weight: bold;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

/* Button and icon */
.expand-btn {
    cursor: pointer;
    margin-left: 8px;
    color: #007bff;
}

.btn.btn-sm.btn-light {
    padding: 2px 6px;
    font-size: 14px;
    margin-right: 5px;
}

/* Hierarchy nesting */
.hierarchy-content .nested-content {
    background-color: #f0f0f0;
    padding: 10px 20px;
}

/* Responsive design */
@media screen and (max-width: 768px) {
    .card-header h5 {
        font-size: 14px;
        flex: 1 0 100%;
        text-align: center;
        margin-bottom: 10px;
    }

    .table th,
    .table td {
        font-size: 14px;
        padding: 6px 8px;
    }

    .expand-btn,
    .btn-sm {
        font-size: 11px;
    }
}

body {
    background-color: #f8f9fa;
}

.card {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
    padding-top: 0;
    padding-bottom: 0;
}

tr.hierarchy-row .level-6 {
    padding-left: 188px;
}

.employee-list .card-header h5 {
    font-size: 14px;
    padding-bottom: 0;
}

.card-header {
    padding: 5px 9px;
}

.card-header.bg-primary {
    background-color: #2865f6 !important;
    padding: 8px 10px;
}

.expandable {
    cursor: pointer;
}

.expandable:hover {
    background-color: #f8f9fa;
}

/* Show division rows by default */
.expandable:not(.child-row) {
    display: table-row;
}

.child-row {
    display: none;
}

tr[data-class] td:first-child {
    padding-left: 2rem;
}

tr[data-class] tr[data-class] td:first-child {
    padding-left: 4rem;
}

/* Add a subtle background to division rows */
.expandable:not(.child-row) {
    background-color: #f8f9fa;
}

/* Add hover effect */
.expandable:hover td {
    background-color: #e9ecef;
}

.text-success {
    color: #28a745 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.form-control-sm:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
}

.division-row {
    display: table-row;
}

.division-cell {
    padding: 1.5rem !important;
    width: 25%;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: background-color 0.3s;
}

.division-cell:hover {
    background-color: #e9ecef;
}

.division-content {
    text-align: center;
}

.division-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.division-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.arrow {
    display: inline-block;
    margin-left: 0.5rem;
    transition: transform 0.3s;
}

.collapsed .arrow {
    transform: rotate(-90deg);
}

.inner-table {
    margin-top: -1px;
}

.child-row {
    display: none;
}

.child-row td {
    padding-left: 2rem;
}

.child-row .child-row td {
    padding-left: 4rem;
}

.has-children {
    cursor: pointer;
    font-weight: 500;
    color: #2c5282;
    position: relative;
    padding-left: 1.5rem !important;
}

.has-children .arrow {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s;
    font-size: 0.8rem;
}

.expanded .arrow {
    transform: translateY(-50%) rotate(90deg);
}

.inner-table {
    margin: 0;
    background: #fff;
}

.inner-table td {
    border-top: none !important;
}

.inner-table tr:first-child td {
    border-top: 1px solid #dee2e6 !important;
}

.child-row>td {
    padding: 0 !important;
    border-top: none !important;
}

/* Indentation for hierarchical levels */
.child-row .inner-table td:first-child {
    padding-left: 2rem !important;
}

.child-row .child-row .inner-table td:first-child {
    padding-left: 3rem !important;
}

.child-row .child-row .child-row .inner-table td:first-child {
    padding-left: 4rem !important;
}

/* Hover effect for expandable rows */
.has-children:hover {
    background-color: #ebf4ff;
}

/* Status badges for employees */
.employee-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-present {
    background-color: #d4edda;
    color: #155724;
}

.status-leave {
    background-color: #fff3cd;
    color: #856404;
}

.status-absent {
    background-color: #f8d7da;
    color: #721c24;
}

.hierarchy-container {
    padding: 0rem;
}

.hierarchy-item {
    margin-bottom: 0.5rem;
}

.hierarchy-header {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.hierarchy-header:hover {
    background: #e9ecef;
}

.hierarchy-header .arrow {
    margin-right: 0.75rem;
    transition: transform 0.3s;
}

.hierarchy-header.expanded .arrow {
    transform: rotate(90deg);
}

.hierarchy-header .title {
    font-weight: 500;
    flex: 1;
}

.hierarchy-header .stats {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.hierarchy-header .stats .badge {
    min-width: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
}

.badge-info {
    background-color: #404449 !important
}

.status-badges {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.badge-secondary {
    background-color: #525559 !important;
}

.badge-dark {
    background-color: #656667 !important;
}

.status-badges .badge {
    min-width: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.hierarchy-content {
    padding-left: 2rem;
    margin-top: 0.5rem;
}

.badge {
    padding: 0.4rem 0.6rem;
}

/* Level-specific styles */
.level-1 .hierarchy-header {
    background: #fff3e0;
}

.level-2 .hierarchy-header {
    background: #e3f2fd;
}

.level-3 .hierarchy-header {
    background: #e8f5e9;
}

.level-4 .hierarchy-header {
    background: #fce4ec;
}

.level-5 .hierarchy-header {
    background: #f3e5f5;
}

.level-6 .hierarchy-header {
    background: #e8eaf6;
}

/* Add these to your existing styles */
.header-content {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 1rem;
}

.level-label {
    min-width: 100px;
}

.level-label .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hierarchy-header {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.3s;
    gap: 1rem;
}

/* Update the title style */
.hierarchy-header .title {
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Update the division header */
.division-item>.hierarchy-header {
    background: #f3f4f6;
}

.division-item>.hierarchy-header .level-label .badge {
    background: #2f3031;
}

/* Add these new styles */
.select2-container--default .select2-selection--single {
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.5;
    padding-left: 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
}

.department-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.department-details .badge {
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
}

/* Department specific colors */
.level-department .hierarchy-header {
    background: #e8eaf6;
    border-left: 4px solid #3f51b5;
}

.department-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.department-stats .badge {
    min-width: 80px;
    text-align: center;
}

.toggle-departments {
    cursor: pointer;
    margin-right: 10px;
}

.location-row {
    background-color: #fff;
}

.location-row:hover {
    background-color: #f5f5f5;
}

.department-row {
    background-color: #f8f9fa;
}

.card-header {
    cursor: pointer;
    padding: 0.75rem 1.25rem;
}

.card-header i {
    transition: transform 0.3s;
}

.card-header.collapsed i {
    transform: rotate(-90deg);
}

.toggle-children {
    cursor: pointer;
    margin-right: 10px;
    transition: transform 0.2s;
}

.expanded .toggle-children {
    transform: rotate(90deg);
}

.nested-table {
    margin: 0;
    width: 100%;
}

.nested-table table {
    margin: 0;
}

.hierarchy-row {
    background-color: #fff;
}

.hierarchy-row:hover {
    background-color: #f5f5f5;
}

.level-1 {
    padding-left: 20px;
}

.level-2 {
    padding-left: 40px;
}

.level-3 {
    padding-left: 60px;
}

.level-4 {
    padding-left: 80px;
}

.level-5 {
    padding-left: 100px;
}

.employee-list {
    padding-left: 0px;
    background-color: #f8f9fa;
}

.hierarchy-row {
    cursor: pointer;
    height: 23px;
}

.toggle-children {
    display: inline-block;
    width: 20px;
    text-align: center;
    transition: transform 0.2s;
}

.expanded .toggle-children {
    transform: rotate(90deg);
}

.hierarchy-content {
    background-color: #f8f9fa;
}

.nested-table {
    width: 100%;
}

.table {
    margin-bottom: 0;
    width: 100%;
}

.table td,
.table th {
    padding: 0.5rem;
    vertical-align: middle;
    font-size: 14px !important;
}

/* Fixed column widths */
.table td:nth-child(1) {
    width: 60%;
}

.table td:nth-child(2),
.table td:nth-child(3),
.table td:nth-child(4),
.table td:nth-child(5) {
    width: 10%;
    text-align: right;
}

/* Update parent table styles to match child table */
#attendanceTable {
    width: 100%;
    table-layout: fixed;
}

#attendanceTable thead th {
    width: 60%;
}

#attendanceTable thead th:nth-child(2),
#attendanceTable thead th:nth-child(3),
#attendanceTable thead th:nth-child(4),
#attendanceTable thead th:nth-child(5) {
    width: 10%;
    text-align: right;
}

#attendanceTable tbody td {
    width: 60%;
}

#attendanceTable tbody td:nth-child(2),
#attendanceTable tbody td:nth-child(3),
#attendanceTable tbody td:nth-child(4),
#attendanceTable tbody td:nth-child(5) {
    width: 10%;
    text-align: right;
}

/* Ensure nested tables maintain the same structure */
.nested-content table {
    width: 100%;
    table-layout: fixed;
}

.nested-content table td:nth-child(1) {
    width: 60%;
}

.nested-content table td:nth-child(2),
.nested-content table td:nth-child(3),
.nested-content table td:nth-child(4),
.nested-content table td:nth-child(5) {
    width: 10%;
    text-align: right;
}

/* Ensure consistent cell padding */
.table td,
.table th,
.nested-content table td,
.nested-content table th {
    padding: 0.5rem;
    vertical-align: middle;
    font-size: 14px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hierarchy-row {
    cursor: pointer;
    height: 23px;
}

.toggle-children {
    display: inline-block;
    width: 20px;
    text-align: center;
    transition: transform 0.2s;
}

.expanded .toggle-children {
    transform: rotate(90deg);
}

.nested-content {
    width: 100%;
}

.nested-content .table {
    margin: 0;
}

/* Level indentation */
.level-1 {
    padding-left: 2rem !important;
}

.level-2 {
    padding-left: 4rem !important;
}

.level-3 {
    padding-left: 6rem !important;
}

.level-4 {
    padding-left: 8rem !important;
}

.level-5 {
    padding-left: 10rem !important;
}

/* Remove borders for nested tables */
.nested-content .table {
    border: none;
}

.nested-content .table td {
    border-left: none;
    border-right: none;
    border: 1px solid #dee2e6;
}

.nested-content .table tr:last-child td {
    border-bottom: none;
}

/* Consistent row heights */
.table td {
    height: 23px;
    white-space: nowrap;
    overflow: hidden;
    font-size: 11px;
    padding-top: 0;
    padding-bottom: 0;
    text-overflow: ellipsis;
}

/* Employee list styling */
.employee-list {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.employee-row {
    background-color: #f8f9fa;
    height: 23px;
    font-size: 11px !important;
}

.employee-row td {
    padding: 0 5px !important;
    vertical-align: middle;
}

.nav {
    background: #fff;
    padding: 10px 0px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navigation {
    background-color: #2865F6;
    height: 60px;
    display: flex;
    align-items: center;
}

.navigation .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navigation h1 {
    color: #fff;
    margin-bottom: 0;
    font-size: 23px;
}

.navigation .box {
    text-align: center;
    margin: 0px 13px;
}

.navigation p {
    margin-bottom: 0;
    color: #fff;
}

.card {
    margin-top: 30px;
}

#app {
    background: #fff;
}

#app .py-4 {
    padding-top: 0px !important;
}

.hierarchy-container .card {
    width: 100%;
}

.table td {
    font-size: 15px !important;
}

.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
    padding: 5px 5px !important;
    font-size: 14px !important;
}

.btn-secondary {
    padding: 5px 5px !important;
    font-size: 14px !important;
}

.table thead th {
    font-size: 17px;
}

.form-control-sm {
    /* padding: 10px 20px; */
    height: 40px;
}

.select2-container--default .select2-selection--single {
    height: 40px !important;
}

.badge-danger {
    background-color: transparent;
    color: #dc3545;
    padding: 0;
    font-weight: 900 !important;
    font-size: 13px;
}

.badge-success {
    color: #28a745;
    background-color: transparent;
    font-weight: 900 !important;
    font-size: 13px;
    display: block;
    position: relative;
    left: -23%;
}

.badge-warning {
    color: #ffbc00;
    background-color: transparent;
    font-weight: 900 !important;
    font-size: 13px;
    display: block;
    position: relative;
    left: -11%;
}

span.blue-color {
    color: #2865f6;
}

span.orge-color {
    color: #ffbc00;
}

span.red-color {
    color: #dc3545;
}

span.green-color {
    color: #28a745;
}

.department-row {
    display: flex;
    align-items: center;
}

.department-row .form-group {
    margin-bottom: 0px !important;
}

.hierarchy-container h5 {
    font-size: 17px !important;
}

.loading {
    text-align: center;
    padding: 10px;
    color: #666;
}

.loading:after {
    content: '...';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60% {
        content: '...';
    }

    80%,
    100% {
        content: '';
    }
}

/* Add these styles to ensure consistent styling for child rows */
.hierarchy-content .hierarchy-row {
    background-color: #fff;
    height: 23px;
}

.hierarchy-content .hierarchy-row td {
    font-size: 16px !important;
    padding: 0;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hierarchy-content .hierarchy-row:hover {
    background-color: #f5f5f5;
}

.hierarchy-content .expand-btn {
    padding: 0 5px !important;
    font-size: 14px !important;
    height: 20px;
    line-height: 1;
}

.hierarchy-content .toggle-children {
    font-size: 14px;
    margin-right: 5px;
}

.hierarchy-content .badge {
    font-size: 11px !important;
    padding: 2px 5px !important;
}

.hierarchy-content .employee-row {
    height: 23px;
    font-size: 11px !important;
    padding: 0 !important;
}

.hierarchy-content .employee-row td {
    padding: 0 5px !important;
    vertical-align: middle;
}

/* Ensure consistent text alignment */
.hierarchy-content .text-right {
    text-align: right !important;
}

/* Ensure consistent table borders */
.hierarchy-content table {
    border-collapse: collapse;
    width: 100%;
}

.hierarchy-content td {
    border: 1px solid #dee2e6;
}

/* Loading indicator styling */
.loading {
    text-align: center;
    padding: 5px;
    font-size: 11px;
    color: #666;
}

/* Status badge styles */
.badge {
    padding: 0.25rem 0.5rem;
    font-size: 11px !important;
    font-weight: 600;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* Employee row styles */
.employee-row {
    background-color: #f8f9fa;
    height: 23px;
    font-size: 11px !important;
}

.employee-row td {
    padding: 0 5px !important;
    vertical-align: middle;
}

/* Status column alignment */
.status-column {
    text-align: center !important;
}

/* Hierarchy row styles */
.hierarchy-row {
    cursor: pointer;
    height: 23px;
}

.hierarchy-row td {
    font-size: 14px !important;
    padding: 0 5px !important;
}

/* Toggle button styles */
.expand-btn {
    padding: 0 5px !important;
    font-size: 14px !important;
    height: 20px;
    line-height: 1;
}

.toggle-children {
    font-size: 14px;
    margin-right: 5px;
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 5px;
    font-size: 11px;
    color: #666;
}

/* Table header styles */
.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
    padding: 8px 5px;
    text-align: center;
}

/* Status colors */
span.blue-color {
    color: #2865f6;
}

span.orge-color {
    color: #ffbc00;
}

span.red-color {
    color: #dc3545;
}

span.green-color {
    color: #28a745;
}

/* Form control styles */
.form-control-sm {
    height: 32px;
    font-size: 14px;
}

.select2-container--default .select2-selection--single {
    height: 32px !important;
}

/* Button styles */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 0.2rem;
}

.hierarchy-content {
    background-color: #f8f9fa;
}

.hierarchy-content .employee-row {
    background-color: #fff;
}

.hierarchy-content .employee-row:hover {
    background-color: #f5f5f5;
}

.status-column {
    text-align: center !important;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 11px !important;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* Ensure proper spacing for nested content */
.nested-content {
    padding: 0;
}

.nested-content .employee-row td {
    padding: 0 5px !important;
    height: 23px;
    line-height: 23px;
    vertical-align: middle;
}

/* Table structure and widths */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

#attendanceTable,
.nested-content table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

/* Consolidated table column widths */
#attendanceTable,
.nested-content table,
.hierarchy-content table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
}

/* First column width (60%) */
#attendanceTable th:first-child,
#attendanceTable td:first-child,
.nested-content table th:first-child,
.nested-content table td:first-child,
.hierarchy-content table th:first-child,
.hierarchy-content table td:first-child {
    width: 60% !important;

}

/* Other columns width (10% each) */
#attendanceTable th:not(:first-child),
#attendanceTable td:not(:first-child),
.nested-content table th:not(:first-child),
.nested-content table td:not(:first-child),
.hierarchy-content table th:not(:first-child),
.hierarchy-content table td:not(:first-child) {}

/* Ensure consistent cell content */
#attendanceTable td,
#attendanceTable th,
.nested-content table td,
.nested-content table th,
.hierarchy-content table td,
.hierarchy-content table th {
    padding: 0.5rem !important;
    vertical-align: middle !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    border: 1px solid #dee2e6 !important;
}

/* Remove any conflicting width styles */
.hierarchy-content table,
.nested-table,
.inner-table {
    width: 100% !important;
    table-layout: fixed !important;
}

/* Ensure the hierarchy content takes full width */
.hierarchy-content {
    width: 100%;
}

.nested-content {
    width: 100%;
    padding: 0;
}

/* Override any existing width styles */
.table td[style*="width"],
.table th[style*="width"],
.nested-content table td[style*="width"],
.nested-content table th[style*="width"],
.hierarchy-content table td[style*="width"],
.hierarchy-content table th[style*="width"] {
    width: auto !important;
}

/* Employee row specific widths */
.employee-row td:first-child {
    width: 60% !important;
    min-width: 60% !important;
    max-width: 60% !important;
}

.employee-row td:nth-child(2),
.employee-row td:nth-child(3),
.employee-row td:nth-child(4),
.employee-row td:nth-child(5) {
    width: 10% !important;
    min-width: 10% !important;
    max-width: 10% !important;
    text-align: right !important;
}

/* Ensure status column alignment */
.employee-row .status-column {
    text-align: center !important;
}

/* Ensure employee row padding is consistent */
.employee-row td {
    padding: 0 5px !important;
    /* Adjust padding as needed */
    vertical-align: middle !important;
    height: 23px !important;
    /* Ensure consistent row height */
    line-height: 23px !important;
    /* Center text vertically */
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Consolidated and enforced table column widths */
#attendanceTable,
.nested-content table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
}

#attendanceTable th,
#attendanceTable td,
.nested-content table th,
.nested-content table td {
    /* Ensure borders are applied */
    border: 1px solid #dee2e6 !important;
    padding: 0.5rem !important;
    /* Consistent padding */
    vertical-align: middle !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/*#attendanceTable th:first-child,
    #attendanceTable td:first-child,
    .nested-content table th:first-child,
    .nested-content table td:first-child {
        width: 60% !important;
        min-width: 60% !important;
        max-width: 60% !important;
    }*/

/* #attendanceTable th:not(:first-child),
    #attendanceTable td:not(:first-child),
    .nested-content table th:not(:first-child),
    .nested-content table td:not(:first-child) {
        width: 10% !important;
        min-width: 10% !important;
        max-width: 10% !important;
        text-align: right !important;
    } */

/* Special alignment for status columns */
#attendanceTable .status-column,
.nested-content table .status-column {
    text-align: center !important;
}

/* Remove any potentially conflicting styles for nested content */
.hierarchy-content {
    padding-left: 0 !important;
    /* Remove left padding */
    margin-top: 0.5rem;
}

.nested-content {
    width: 100% !important;
    padding: 0 !important;
}

/* Ensure employee rows inherit the same column widths */
.employee-row td {
    /* These styles should be covered by the general td/th rules above,
       but keeping them here with !important as a fallback */
    width: 10% !important;
    min-width: 10% !important;
    max-width: 10% !important;
    padding: 0 5px !important;
    vertical-align: middle !important;
    height: 23px !important;
    line-height: 23px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.employee-row td:first-child {
    width: 60% !important;
    min-width: 60% !important;
    max-width: 60% !important;
}

/* Enforce consistent column widths for all table cells */
#attendanceTable td,
.nested-content table td {
    padding: 0.5rem !important;
    vertical-align: middle !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/*#attendanceTable td:first-child,
    .nested-content table td:first-child {
        width: 60% !important;
        min-width: 60% !important;
        max-width: 60% !important;
    }
    */
/* #attendanceTable td:not(:first-child),
    .nested-content table td:not(:first-child) {
        width: 10% !important;
        min-width: 10% !important;
        max-width: 10% !important;
        text-align: right !important;
    } */

/* Explicitly target employee row cells for consistent styling */
.employee-row td {
    padding: 0 5px !important;
    /* Adjust padding for employee rows if needed */
    vertical-align: middle !important;
    height: 23px !important;
    line-height: 23px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    border: 1px solid #dee2e6 !important;
    /* Ensure borders */
}

.employee-row td:first-child {
    width: 60% !important;
    min-width: 60% !important;
    max-width: 60% !important;
}

.employee-row td:not(:first-child) {
    width: 10% !important;
    min-width: 10% !important;
    max-width: 10% !important;
    text-align: right !important;
}

/* Ensure status column alignment in employee rows */
.employee-row .status-column {
    text-align: center !important;
}

/* Remove any potentially conflicting styles for nested content padding */
.nested-content {
    padding: 0 !important;
}

/* Core table styles */
.table {
    margin-bottom: 0;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

/* Column widths */
.table td:first-child,
.table th:first-child {
    width: 60% !important;
}

.table td:not(:first-child),
.table th:not(:first-child) {
    width: 10% !important;
    text-align: right !important;
}

/* Interactive elements */
.hierarchy-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.hierarchy-row:hover {
    background-color: #f8f9fa;
}

.expand-btn {
    cursor: pointer;
    padding: 2px 6px;
    font-size: 14px;
    margin-right: 5px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.expand-btn:hover {
    background-color: #e9ecef;
}

/* Nested content styles */
.nested-content {
    width: 100%;
    padding: 0;
}

.nested-content table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.nested-content td {
    padding: 8px;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status colors */
.badge-success {
    color: #28a745;
}

.badge-warning {
    color: #ffbc00;
}

.badge-danger {
    color: #dc3545;
}

/* --- Enhanced Animations and Visual Effects --- */
.expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0 !important;
    margin-right: 8px;
    border-radius: 4px;
    background-color: #f5f8ff;
    border: 1px solid #cce2ff;
    color: #2865F6;
    outline: none;
    box-shadow: none;
    transition: all 0.2s ease;
}
.expand-btn:hover {
    background-color: #e3f0ff;
    border-color: #2865F6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 101, 246, 0.2);
}
.expand-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(40, 101, 246, 0.2);
}
.toggle-children {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}
.fa-chevron-down {
    transform: rotate(90deg);
}
.hierarchy-content {
    transition: opacity 0.25s ease-in-out, max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
}
.hierarchy-content.open {
    opacity: 1;
    max-height: 2000px;
}
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    color: #666;
    font-size: 14px;
}
.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 3px solid rgba(40, 101, 246, 0.2);
    border-radius: 50%;
    border-top-color: #2865F6;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.hierarchy-row.active {
    background-color: #f0f7ff !important;
}
.hierarchy-row:hover {
    background-color: #f5f5f5;
    transition: background-color 0.2s ease;
}
.desc{
    font-size: 16px;
    font-weight: 500;
}
 .filters-section {
        background: #f8f9fa;
        padding: 1.5rem;
        border-radius: 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    .legend-section {
        background: #fff;
        padding: 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    }
    
    .legend-item {
        display: inline-flex;
        align-items: center;
        margin: 0 1rem;
    }
    
    .legend-text {
        margin-left: 0.5rem;
        font-size: 0.875rem;
        color: #6c757d;
    }
    
    .badge {
        padding: 0.5em 0.75em;
        font-weight: 500;
    }
    
    .stats {
        background: rgba(255,255,255,0.1);
        padding: 0.5rem 1rem;
        border-radius: 0.25rem;
    }
    
    .stat-item {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .stat-label {
        font-size: 0.75rem;
        opacity: 0.8;
    }
    
    .stat-value {
        font-size: 1.25rem;
        font-weight: 600;
    }
    
    .table th {
        font-weight: 600;
        border-top: none;
    }
    
    .division-row {
        transition: background-color 0.2s ease;
    }
    
    .division-row:hover {
        background-color: #f8f9fa;
    }
    
    .expand-btn {
        width: 28px;
        height: 28px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-right: 0.5rem;
        border-radius: 50%;
        transition: all 0.2s ease;
    }
    
    .expand-btn:hover {
        background-color: #e9ecef;
    }
    
    .expand-btn.expanded {
        transform: rotate(90deg);
    }
    
    .division-name {
        font-weight: 500;
    }
    
    .hierarchy-content {
        background-color: #f8f9fa;
    }
    
    .hierarchy-content.open {
        transition: all 0.3s ease;
    }
    
    .loading {
        padding: 2rem;
        text-align: center;
        color: #6c757d;
    }
    
    .select2-container--default .select2-selection--single {
        height: calc(1.5em + 0.75rem + 2px);
        padding: 0.375rem 0.75rem;
        border: 1px solid #ced4da;
        border-radius: 0.25rem;
    }
    
    .btn-group .btn {
        padding: 0.375rem 1rem;
    }
    
    .employee-row td {
        padding: 0.5rem 1rem;
    }
    
    .employee-row:hover {
        background-color: #f8f9fa;
    }