/* Tree Container */
.tree-scroll-wrapper {
    overflow: auto;
    padding-bottom: 3rem;
    cursor: grab;
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    min-height: 600px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 3rem;

    /* Subtle grid pattern background */
    background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 20px 20px;
}

.tree-scroll-wrapper:active {
    cursor: grabbing;
}

.tree {
    display: inline-table; /* Fit content */
    margin: 0 auto;
    width: 100%;
}

.tree ul {
    padding-top: 20px;
    position: relative;
    transition: all 0.5s;
    display: flex;
    justify-content: center;
    margin: 0;
    padding-inline-start: 0;
}

.tree li {
    float: left;
    text-align: center;
    list-style-type: none;
    position: relative;
    padding: 20px 10px 0 10px;
    transition: all 0.5s;
}

/* Connectors with smooth curves */
.tree li::before,
.tree li::after {
    content: "";
    position: absolute;
    top: 0;
    right: 50%;
    border-top: 2px solid var(--connector-color);
    width: 50%;
    height: 20px;
}

.tree li::after {
    right: auto;
    left: 50%;
    border-left: 2px solid var(--connector-color);
}

.tree li:only-child::after,
.tree li:only-child::before {
    display: none;
}

.tree li:only-child {
    padding-top: 0;
}

/* RTL Specific Connector Logic */
.tree li:first-child::after,
.tree li:last-child::before {
    display: none;
}

.tree li:first-child::before {
    border-right: 2px solid var(--connector-color);
    border-radius: 0 12px 0 0;
}

.tree li:last-child::after {
    border-radius: 12px 0 0 0;
    border-left: 2px solid var(--connector-color);
}

/* Remove vertical line from the pseudo-element we aren't using for corners to prevent double thickness or artifacts */
.tree li:first-child::after {
    border-left: none;
}

.tree ul ul::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    border-left: 2px solid var(--connector-color);
    width: 0;
    height: 20px;
}

.person-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    text-decoration: none;
    color: var(--text-main);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Center content vertically */
    border-radius: 24px;
    width: 160px; /* Fixed width */
    min-height: 178px; /* Fixed minimum height */
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    backdrop-filter: blur(10px);
    padding: 15px;
}

.person-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary-color);
    z-index: 100;
}

/* Active/Selected State */
.person-card.active {
    border-color: var(--primary-color);
    background-color: #f8fafc;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Root Person Style (Top Ancestor) */
.person-card.root-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #fcd34d;
    transform: scale(1.1);
}

.person-card.root-card .name {
    color: #92400e;
    font-size: 1.2rem;
}

.person-card img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 3px solid #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    padding: 2px;
    background: #fff;
}

.person-card:hover img {
    transform: scale(1.1);
}

.avatar-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 800;
    color: #64748b;
    border: 3px solid #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Gender Specific Borders with gradient feeling */
.person-card.gender-male img,
.person-card.gender-male .avatar-placeholder {
    border-color: #60a5fa; /* Light Blue */
    background: linear-gradient(to bottom right, #fff, #eff6ff);
}

.person-card.gender-female img,
.person-card.gender-female .avatar-placeholder {
    border-color: #f472b6; /* Light Pink */
    background: linear-gradient(to bottom right, #fff, #fdf2f8);
}

/* Deceased Styling - DISTINCT */
.person-card.is-deceased {
    background: linear-gradient(145deg, #fff1f2, #ffe4e6) !important;
    border: 2px solid #fecdd3 !important;
    opacity: 0.9;
}

.person-card.is-deceased .name {
    color: #9f1239 !important; /* Rose 800 */
    text-decoration: line-through; /* Optional: adds effect */
    text-decoration-color: #fda4af;
}

.person-card.is-deceased img,
.person-card.is-deceased .avatar-placeholder {
    border-color: #f43f5e !important; /* Rose 500 */
    filter: grayscale(1) contrast(1.2);
}

/* .person-card.is-deceased .name::after {
        content: '(رحمه الله)';
       display: none; 
    } */

.name {
    font-weight: 800;
    font-size: 15px;
    margin-bottom: 8px;
    color: #1e293b;
    text-align: center;
    line-height: 1.4;
}

.details {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.details span {
    font-size: 11px;
    color: #475569;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 12px; /* Pill shape */
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    transition: background 0.2s;
}

.details span:hover {
    background: #e2e8f0;
}

.details i {
    color: #94a3b8;
    font-size: 10px;
}

.add-child-btn {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: linear-gradient(135deg, var(--primary-color), #4338ca);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 20;
}

.person-card:hover .add-child-btn {
    transform: translateX(-50%) scale(1);
    bottom: -18px;
}

.add-child-btn:hover {
    transform: translateX(-50%) scale(1.15) !important;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

/* Action Buttons (Edit/Delete) */
.actions {
    /* opacity: 0; REMOVED - Controlled by children now */
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 30;
    pointer-events: none; /* Let clicks pass through when hidden */
}

/* Staggered Animation Logic */
.action-btn {
    opacity: 0;
    transform: translateX(10px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
}

.person-card:hover .action-btn {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* Reveal delays for "waterfall" effect */
.person-card:hover .action-btn:nth-child(1) {
    transition-delay: 0ms;
}
.person-card:hover .action-btn:nth-child(2) {
    transition-delay: 50ms;
}
.person-card:hover .action-btn:nth-child(3) {
    transition-delay: 100ms;
}
.person-card:hover .action-btn:nth-child(4) {
    transition-delay: 150ms;
}

.action-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08); /* Softer shadow */
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #64748b;
    backdrop-filter: blur(4px);
}

.action-btn:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* Specific Button Colors (Soft by default) */
.info-btn {
    color: #3b82f6;
}
.edit-btn {
    color: #f59e0b;
}
.delete-btn {
    color: #ef4444;
}
.move-btn {
    color: #8b5cf6;
}

/* Hover states */
.info-btn:hover {
    background: #eff6ff;
    color: #2563eb;
}
.edit-btn:hover {
    background: #fffbeb;
    color: #d97706;
}
.delete-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}
.move-btn:hover {
    background: #f5f3ff;
    color: #7c3aed;
}

.floating-add {
    position: fixed;
    bottom: 10px;
    left: 17px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6); /* Pink to Purple */
    color: white;
    width: 70px;
    height: 70px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; /* Organic shape */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 20px 25px -5px rgba(139, 92, 246, 0.5);
    cursor: pointer;
    z-index: 900;
    transition: all 0.5s ease;
    border: none;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

.floating-add:hover {
    transform: scale(1.1) rotate(180deg);
    border-radius: 50%;
}

/* Empty State Styling */
.empty-state-card {
    background: #ffffff;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: inline-block;
    max-width: 500px;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.icon-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-wrapper i {
    font-size: 50px;
    color: #10b981; /* Emerald 500 */
    z-index: 2;
    position: relative;
}

.icon-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #d1fae5; /* Emerald 100 */
    z-index: 1;
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Premium Search Stylings */
.search-wrapper {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    z-index: 10;
    top: 13px;
}

.search-box {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 5px 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
        0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    border-radius: 20px;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 20px 25px -5px rgba(79, 70, 229, 0.15),
        0 10px 10px -5px rgba(79, 70, 229, 0.1);
    transform: translateY(-2px);
    background: #fff;
}

.search-icon {
    color: #94a3b8;
    padding-left: 15px;
    font-size: 18px;
    transition: color 0.3s;
}

.search-box:focus-within .search-icon {
    color: var(--primary-color);
}

.search-input {
    border: none;
    background: transparent;
    width: 100%;
    padding: 10px;
    font-size: 16px;
    color: var(--text-main);
    font-weight: 500;
    outline: none;
}

.search-input::placeholder {
    color: #cbd5e1;
}

/* Zoom Controls */
.zoom-controls {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
}

.zoom-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: white;
    color: var(--text-main);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 18px;
}

.zoom-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Tree Navigation Styles */
#tree-wrapper {
    overflow: hidden; /* Hide overflow for panning */
    cursor: grab;
    position: relative;
    height: 100vh; /* Fixed height viewport */
    background-color: #f8fafc;
    border-radius: 20px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
}

#tree-wrapper:active {
    cursor: grabbing;
}

#tree-container {
    transform-origin: center top;
    transition: transform 0.1s ease-out; /* Smooth movement */
    min-width: fit-content;
    display: inline-block;
}

/* Add dot pattern background for context */
#tree-wrapper::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.5;
    pointer-events: none;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .modal {
        border-radius: 0 !important;
    }
    .modal.show .modal-dialog {
        margin: 0;
    }
    header {
        padding: 10px 1rem;
    }
    .dashboard-btn-float {
        bottom: 10px  !important;
        right: 8px !important;
        width: 38px !important;
        height: 38px !important;
    }
    .zoom-controls {
        bottom: 20px;
        right: 20px;
        gap: 8px;
        padding: 8px;
    }

    .zoom-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    #tree-wrapper {
        border-radius: 15px;
    }

    .search-wrapper {
        width: 95%; /* Prevent touching edges */
        top: 0; /* Reset top offset */
    }

    /* Stack filters with spacing */
    #filterPanel .col-md-3 {
        margin-bottom: 10px;
    }

    #filterPanel .card-body {
        padding: 10px;
    }

    /* Compact Person Card for Mobile */
    .person-card {
        width: 110px !important;
        min-height: 140px !important;
        border-radius: 14px !important;
        padding: 5px !important;
    }

    .person-card.root-card {
        transform: scale(1) !important;
        border-width: 2px !important;
        margin-bottom: 5px;
    }

    .person-card img,
    .avatar-placeholder {
        width: 45px !important;
        height: 45px !important;
        margin-bottom: 6px !important;
        border-width: 2px !important;
        font-size: 16px !important;
    }

    .name {
        font-size: 11px !important;
        margin-bottom: 4px !important;
        line-height: 1.2 !important;
    }

    .details span {
        font-size: 8px !important;
        padding: 2px 4px !important;
        gap: 2px !important;
    }

    .details i {
        font-size: 7px !important;
    }

    .tree li {
        padding: 10px 2px 0 2px;
    }

    /* Adjust connectors */
    .tree li::before,
    .tree li::after {
        height: 12px;
    }
    .tree ul ul::before {
        height: 12px;
    }

    /* Smaller Action Buttons */
    .action-btn {
        width: 22px;
        height: 22px;
        font-size: 9px;
    }

    .actions {
        opacity: 1; /* Always visible on mobile */
        top: 5px;
        right: 5px;
        flex-direction: column;
        gap: 4px;
    }

    .add-child-btn {
        width: 24px;
        height: 24px;
        font-size: 10px;
        bottom: -12px;
    }

    .person-card:hover .add-child-btn {
        bottom: -12px;
    }
}

/* Statistics Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    padding: 0 10px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

/* Specific Stat Colors */
.stat-living .stat-icon {
    background: #dcfce7;
    color: #16a34a;
}
.stat-deceased .stat-icon {
    background: #fee2e2;
    color: #dc2626;
}
.stat-male .stat-icon {
    background: #dbeafe;
    color: #2563eb;
}
.stat-female .stat-icon {
    background: #fce7f3;
    color: #db2777;
}
.stat-young .stat-icon {
    background: #fef9c3;
    color: #ca8a04;
} /* Under 18 */
.stat-old .stat-icon {
    background: #e0e7ff;
    color: #4f46e5;
} /* Over 18 */

/* Sidebar & Stats Styling */
.dashboard-btn-float {
    position: fixed;
    /* top: 85px; */
    padding: 32px;
    right: 20px;
    z-index: 1040;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    border-radius: 50%;
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; /* Organic shape */
  
  animation: float 6s ease-in-out infinite;
}

.dashboard-btn-float:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    background: white;
    color: var(--primary-color);
}
/* Premium Modal Styling */
.modal-premium .modal-content {
    border: none;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-premium .modal-header {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    padding: 20px 24px;
    border: none;
}

.modal-premium .modal-title {
    color: white;
    font-weight: 800;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-premium .btn-close-white {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

/* Custom Input Groups (RTL Optimized) */
.form-floating-custom {
    position: relative;
    margin-bottom: 20px;
}

.form-floating-custom .form-control {
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    padding-right: 45px; /* Space for icon on Right */
    padding-left: 15px;
    padding-top: 25px; /* More space for label */
    padding-bottom: 10px;
    height: auto;
    background-color: #f8fafc;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: right; /* Ensure Arabic text aligns right */
}

.form-floating-custom .form-control:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
    background-color: #fff;
}

.form-floating-custom label {
    position: absolute;
    top: 0;
    right: 0;
    padding: 18px 45px 0 15px; /* Matches input padding */
    font-size: 0.95rem;
    color: #64748b;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    transform-origin: top right;
}

/* Floating Label Logic */
.form-floating-custom .form-control:focus ~ label,
.form-floating-custom .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.85) translateY(-8px);
    opacity: 0.8;
    color: #8b5cf6;
}

.form-floating-custom .input-icon {
    position: absolute;
    right: 16px; /* Icon on Right */
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
    transition: color 0.3s;
    z-index: 5;
}

.form-floating-custom .form-control:focus ~ .input-icon {
    color: #8b5cf6;
}

/* Gender Segmented Control */
.gender-label-title {
    font-weight: 700;
    color: #475569;
    font-size: 0.95rem;
    margin-bottom: 12px;
    display: block;
    text-align: right;
}

.gender-toggle {
    background: #f1f5f9;
    padding: 5px;
    border-radius: 16px;
    display: flex;
    border: 1px solid #e2e8f0;
}

.gender-toggle input[type="radio"] {
    display: none;
}

.gender-btn {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid transparent;
}

.gender-btn i {
    font-size: 1.1rem;
}

/* Selected State */
.gender-toggle input:checked + .gender-btn {
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.gender-toggle input[value="male"]:checked + .gender-btn {
    color: #2563eb; /* Strong Blue */
    border-color: #bfdbfe;
}

.gender-toggle input[value="female"]:checked + .gender-btn {
    color: #db2777; /* Strong Pink */
    border-color: #fbcfe8;
}

.gender-btn:hover {
    background: rgba(255, 255, 255, 0.6);
}

.offcanvas-custom {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(226, 232, 240, 0.8);
}

.offcanvas-header-custom {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 20px;
}

/* Compact Stats for Sidebar */
.sidebar-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card-mini {
    background: white;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.stat-card-mini:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.stat-icon-mini {
    font-size: 18px;
    margin-bottom: 5px;
}

.stat-value-mini {
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 2px;
}

.stat-label-mini {
    font-size: 10px;
    color: #64748b;
    font-weight: 600;
}

/* Sidebar Search Styling */
.sidebar-search-box {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.sidebar-search-box:focus-within {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
