/* 
   SIDEBAR REFINED - INSTITUTIONAL SCALE 
   Centralized CSS for high-fidelity navigation
*/

:root {
    --sidebar-width: 280px;
    --brand-institutional: #b45309;
    --brand-soft: #fffbeb;
    --sidebar-border: #e2e8f0;
}

.sidebar {
    width: var(--sidebar-width) !important;
    background: #ffffff !important;
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    z-index: 100;
}

/* Brand Section */
.sidebar-brand {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.brand-logo {
    width: 48px;
    height: 48px;
    background: #f8fafc;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
}

.brand-logo img { max-height: 32px; width: auto; object-fit: contain; }
.logo-fallback { font-weight: 900; color: var(--brand-institutional); font-size: 1.2rem; }

.brand-text h1 {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--brand-institutional);
    text-transform: uppercase;
    margin: 0;
}

.brand-text span {
    font-size: 0.65rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Navigation Base */
.sidebar-nav { flex: 1; padding: 0 0.75rem; }
.sidebar-nav ul { list-style: none; padding: 0; margin: 0; }

.nav-link {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    color: #475569;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0.2rem;
    border-left: 4px solid transparent;
}

.nav-link:hover {
    background: #f8fafc;
    color: var(--brand-institutional);
    padding-left: 1.25rem;
}

.nav-link.active {
    background: var(--brand-soft) !important;
    color: var(--brand-institutional) !important;
    border-left-color: var(--brand-institutional);
    box-shadow: none;
}

/* Shared Icon Column to fix alignment */
.link-icon {
    flex: 0 0 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.sub-icon { font-size: 0.9rem; opacity: 0.7; }
.link-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Group Styles */
.nav-group { margin-bottom: 0.5rem; }
.nav-group-header {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    cursor: pointer;
    border-radius: 12px;
    color: #64748b;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: 0.2s;
}

.nav-group-header:hover { background: #f8fafc; color: #1e293b; }

.toggle-icon {
    font-size: 0.65rem;
    transition: 0.3s;
    opacity: 0.4;
}

.nav-group.expanded .toggle-icon { transform: rotate(180deg); }
.nav-group-content {
    max-height: 0;
    overflow: hidden;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding-left: 0.5rem;
}

.nav-group.expanded .nav-group-content { 
    max-height: 1000px; 
    padding-top: 0.25rem; 
    padding-bottom: 0.5rem; 
}

.sub-link { padding: 0.6rem 1rem; font-size: 0.85rem; }

/* Footer */
.sidebar-footer { padding: 1.5rem; margin-top: auto; text-align: center; }
.divider { height: 1px; background: #e2e8f0; margin-bottom: 1rem; opacity: 0.5; }
.version { font-size: 0.65rem; font-weight: 800; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; }

/* Global Override to ensure no underlines in sidebar */
.sidebar-nav a, .sidebar-nav a:hover {
    text-decoration: none !important;
}
