/* 
   Cmentaris Admin Sidebar - Unified Styles v3.0.0
   Centralized navigation panel styling to ensure UI stability across all tools.
*/

:root {
    --sidebar-brand-w: 280px;
    --sidebar-bg: #1e293b;
    --text-muted: #94a3b8;
    --nav-active: rgba(255, 255, 255, 0.1);
}

/* SIDEBAR CONTAINER */
.sidebar {
    width: var(--sidebar-brand-w);
    min-width: var(--sidebar-brand-w);
    max-width: var(--sidebar-brand-w);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: white;
    font-family: 'Outfit', sans-serif !important;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 10000;
}

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

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.sidebar-brand img { 
    height: 42px; 
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.2)); 
}

.sidebar-brand span { 
    font-size: 1.5rem; 
    font-weight: 700; 
    letter-spacing: -0.5px; 
    color: white !important;
}

/* CEMETERY SWITCHER (Styles moved to dedicated css/cemetery_switcher.css) */

/* NAVIGATION */
.sidebar-nav {
    flex: 1;
    padding: 20px 15px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 25px;
}

.nav-label {
    padding: 0 15px 10px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: normal;
}

.nav-item i { 
    width: 20px; 
    font-size: 1.1rem; 
    text-align: center; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: white;
    background: #334155;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-weight: 500;
    font-size: 0.95rem;
}

/* FOOTER & LOGOUT */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.logout-link:hover { 
    color: #ef4444; /* Standard danger color */
}

/* COLLAPSIBLE SECTIONS */
.nav-section.collapsible .toggle-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: color 0.2s ease;
    padding-right: 15px;
}

.nav-section.collapsible .toggle-header:hover {
    color: white;
}

.nav-section.collapsible .toggle-header:hover .toggle-icon {
    color: white;
}

.nav-section.collapsible .toggle-icon {
    font-size: 0.75rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #64748b;
}

.nav-section.collapsible.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.nav-section.collapsible.collapsed .nav-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
}

.nav-section.collapsible .nav-content {
    max-height: 600px; /* high enough to contain all items */
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, margin-top 0.3s ease;
    margin-top: 5px;
}

/* RESPONSIVE */
@media (max-width: 1100px) {
    :root {
        --sidebar-brand-w: 0px;
    }
    .sidebar { 
        width: 0; 
        overflow: hidden; 
        display: none; 
    }
}
