/* =============================================
   ERP SIDEBAR — Hierarchical Navigation System
   Restructured sidebar with collapsible sections,
   active states, and "coming soon" visual cues.
   ============================================= */

/* --- Sidebar Section Group Header --- */
.erp-sidebar-group-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #334155;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
    gap: 8px;
    border-radius: 0;
    text-align: left;
}

.erp-sidebar-group-btn:hover {
    background: #f1f5f9;
    color: var(--inv-primary, #6366f1);
}

.erp-sidebar-group-btn .erp-group-icon {
    width: 22px;
    text-align: center;
    font-size: .85rem;
    color: var(--inv-primary, #6366f1);
    flex-shrink: 0;
}

.erp-sidebar-group-btn .erp-group-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.erp-sidebar-group-btn .erp-chevron {
    font-size: .6rem;
    transition: transform .25s cubic-bezier(.4, 0, .2, 1);
    color: #94a3b8;
    flex-shrink: 0;
}

.erp-sidebar-group-btn[aria-expanded="true"] .erp-chevron {
    transform: rotate(90deg);
}

/* --- Sidebar Section Collapse Body --- */
.erp-sidebar-section {
    padding: 0 0 4px 0;
    margin: 0;
}

/* --- Sidebar Navigation Link --- */
.erp-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 8px 40px;
    color: #475569;
    font-size: .82rem;
    font-weight: 500;
    text-decoration: none;
    transition: all .15s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.erp-sidebar-link:hover {
    background: #f1f5f9;
    color: var(--inv-primary, #6366f1);
    text-decoration: none;
}

.erp-sidebar-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, .08), rgba(99, 102, 241, .04));
    color: var(--inv-primary, #6366f1);
    font-weight: 600;
    border-left-color: var(--inv-primary, #6366f1);
}

.erp-sidebar-link i {
    width: 18px;
    text-align: center;
    font-size: .8rem;
    flex-shrink: 0;
}

/* --- Coming Soon Link (dimmed) --- */
.erp-sidebar-link.coming-soon {
    opacity: .55;
    cursor: default;
}

.erp-sidebar-link.coming-soon:hover {
    background: #f8fafc;
    color: #94a3b8;
}

/* --- "Pronto" Badge --- */
.erp-badge-soon {
    margin-left: auto;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: #4f46e5;
    font-size: .58rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* --- Single Top-Level Link (Inicio) --- */
.erp-sidebar-home {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #334155;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .15s ease;
    border-left: 3px solid transparent;
}

.erp-sidebar-home:hover {
    background: #f1f5f9;
    color: var(--inv-primary, #6366f1);
    text-decoration: none;
}

.erp-sidebar-home.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, .08), rgba(99, 102, 241, .04));
    color: var(--inv-primary, #6366f1);
    border-left-color: var(--inv-primary, #6366f1);
}

.erp-sidebar-home i {
    width: 22px;
    text-align: center;
    font-size: .95rem;
    color: var(--inv-primary, #6366f1);
}

/* --- Section Divider --- */
.erp-sidebar-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 4px 16px;
}

/* --- Scrollable Nav Area --- */
.erp-sidebar-nav {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    padding-bottom: 8px;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.erp-sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.erp-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.erp-sidebar-nav::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* --- Sidebar Flex Layout --- */
#sidebar-wrapper {
    display: flex;
    flex-direction: column;
}

/* --- Collapsed State Overrides --- */
#sidebar-wrapper.collapsed .erp-sidebar-group-btn .erp-group-label,
#sidebar-wrapper.collapsed .erp-sidebar-group-btn .erp-chevron,
#sidebar-wrapper.collapsed .erp-sidebar-link span,
#sidebar-wrapper.collapsed .erp-sidebar-home span,
#sidebar-wrapper.collapsed .erp-badge-soon {
    display: none;
}

#sidebar-wrapper.collapsed .erp-sidebar-link {
    padding-left: 0;
    justify-content: center;
}

#sidebar-wrapper.collapsed .erp-sidebar-home {
    justify-content: center;
}

#sidebar-wrapper.collapsed .erp-sidebar-group-btn {
    justify-content: center;
    padding: 10px 8px;
}

#sidebar-wrapper.collapsed .erp-sidebar-section {
    display: none;
}

/* --- Dark Mode --- */
body.dark-mode .erp-sidebar-group-btn {
    color: #cbd5e1;
}
body.dark-mode .erp-sidebar-group-btn:hover {
    background: #1e293b;
}
body.dark-mode .erp-sidebar-link {
    color: #94a3b8;
}
body.dark-mode .erp-sidebar-link:hover {
    background: #1e293b;
    color: #818cf8;
}
body.dark-mode .erp-sidebar-link.active {
    background: rgba(99, 102, 241, .12);
    color: #818cf8;
}
body.dark-mode .erp-sidebar-home {
    color: #e2e8f0;
}
body.dark-mode .erp-sidebar-home:hover {
    background: #1e293b;
}
body.dark-mode .erp-sidebar-divider {
    border-top-color: #334155;
}

/* --- Coming Soon Page Styles --- */
.coming-soon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    background: #f8fafc;
    padding: 24px;
}

.coming-soon-card {
    text-align: center;
    max-width: 420px;
}

.coming-soon-icon {
    font-size: 4rem;
    color: #06b6d4;
    margin-bottom: 20px;
    animation: comingSoonPulse 2s ease-in-out infinite;
}

.coming-soon-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.coming-soon-text {
    font-size: .95rem;
    color: #64748b;
    line-height: 1.6;
}

.coming-soon-text strong {
    color: #334155;
    font-weight: 600;
}

@keyframes comingSoonPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: .85; }
}

body.dark-mode .coming-soon-wrapper {
    background: #0f172a;
}
body.dark-mode .coming-soon-title {
    color: #e2e8f0;
}
body.dark-mode .coming-soon-text {
    color: #94a3b8;
}
body.dark-mode .coming-soon-text strong {
    color: #cbd5e1;
}
