:root {
    --topnav-height: 64px;
    --sidebar-bg: #ffffff;
    --sidebar-border: #edf2f7;
    --sidebar-text: #475569;
    --sidebar-text-soft: #64748b;
    --sidebar-heading: #94a3b8;
    --sidebar-hover: #f8fafc;
    --sidebar-active-bg: #eff6ff;
    --sidebar-active-text: #0d6efd;
    --sidebar-sub-border: #eef2f7;
    --sidebar-footer-bg: #fbfdff;
}

/* păstrează lățimea originală a coloanei */
#layoutSidenav_nav {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    overflow: hidden;
}

/* sidebar */
.custom-sidebar {
    background: var(--sidebar-bg) !important;
    min-height: calc(100vh - var(--topnav-height));
    height: calc(100vh - var(--topnav-height));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: sticky;
    top: var(--topnav-height);
    z-index: 10;
}

/* conținut scrollabil */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.4rem 0.5rem 0.75rem 0.5rem;
    scrollbar-width: thin;
}

/* wrapper */
.nav-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 2px;
}

/* heading */
.sidebar-heading {
    padding: 0.9rem 0.8rem 0.35rem;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--sidebar-heading);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

/* grupuri */
.nav-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 2px;
}

/* MODIFICAT: link principal + simplu */
.nav-link-custom,
.nav-link-single {
    display: flex;
    align-items: center; /* Alinează iconița și săgeata pe centrul textului vertical */
    gap: 0.55rem;
    width: 100%;
    padding: 0.6rem 0.75rem; /* Am mărit puțin padding-ul vertical pentru rânduri multiple */
    color: var(--sidebar-text) !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.2; /* Redus puțin pentru a arăta bine pe 2 rânduri */
    transition: background-color 0.2s ease, color 0.2s ease;
    position: relative;
    box-sizing: border-box;
    height: auto; /* Permite creșterea înălțimii */
}

/* hover */
.nav-link-custom:hover,
.nav-link-single:hover {
    background-color: var(--sidebar-hover);
    color: #0f172a !important;
}

/* active */
.nav-link-single.active,
.nav-link-custom.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text) !important;
}

/* icon */
.nav-icon {
    width: 20px;
    min-width: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    font-size: 0.95rem;
}

/* MODIFICAT: text (Aici am eliminat tăierea textului) */
.nav-text {
    flex: 1;
    min-width: 0;
    white-space: normal; /* Permite trecerea pe rândul nou */
    overflow: visible;    /* Permite vizibilitatea */
    text-overflow: clip;  /* Elimină punctele-puncte */
    word-wrap: break-word; /* Siguranță pentru cuvinte foarte lungi */
}

/* collapse */
.collapse.show {
    display: block;
}

/* submenu */
.nav-sub {
    margin-left: 1.65rem;
    border-left: 1px solid var(--sidebar-sub-border);
    padding: 0.15rem 0 0.45rem 0.45rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-sub-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.38rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--sidebar-text-soft) !important;
    text-decoration: none !important;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
    box-sizing: border-box;
}

.nav-sub-link:hover,
.nav-sub-link.active {
    color: var(--sidebar-active-text) !important;
    background-color: #f1f5f9;
}

/* săgeata */
.arrow-icon {
    font-size: 0.7rem;
    margin-left: auto;
    transition: transform 0.2s ease;
    color: inherit;
    min-width: 12px; /* Ne asigurăm că săgeata nu se micșorează */
}

.nav-link-custom:not(.collapsed) .arrow-icon {
    transform: rotate(90deg);
}

/* indent */
.sub-indent {
    padding-left: 1.45rem;
}

/* badge */
.badge-custom-sidebar {
    margin-left: auto;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.1rem 0.42rem;
    min-width: 20px;
    text-align: center;
}

/* footer */
.sidebar-footer {
    padding: 0.8rem 0.9rem;
    background: var(--sidebar-footer-bg);
    border-top: 1px solid var(--sidebar-border);
    margin-top: auto;
}

.footer-links-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem;
}

.footer-links-grid a {
    color: var(--sidebar-text-soft);
    text-decoration: none;
    font-size: 0.78rem;
    line-height: 1.35;
}

.footer-links-grid a:hover {
    color: var(--sidebar-active-text);
}

/* steaguri */
.nav-link-single img {
    display: block;
    width: 20px;
    height: auto;
    object-fit: contain;
}