/* site-02-navigation.css: Navigation and page header (04-05).
   Part of the old site.css, split by sections (same order: _Styles.cshtml links them one after the other,
   so the cascade is exactly the same). */

/* =====================================================================
   04. NAVIGATION (modern header, user, dropdown)
   ===================================================================== */
.app-header-modern {
    position: sticky;
    top: 0;
    z-index: 1030;
    width: 100%;
    background: rgba(9, 13, 26, 0.72);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-sm);
}

    .app-header-modern::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: -1px;
        height: 1px;
        background: var(--gradient-vivid);
        opacity: 0.6;
    }

/* Layout of the bar */
.nav-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    max-width: 1560px;
    margin: 0 auto;
    padding: 10px 24px;
}

/* Brand */
.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-decoration: none;
    background-image: none;
}

    .nav-brand:hover {
        background-image: none;
    }

.nav-brand-logo-wrapper {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
}

.nav-escudo-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: var(--transition);
}

.nav-brand:hover .nav-escudo-img {
    transform: scale(1.08);
}

.nav-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.nav-brand-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
    line-height: 1.2;
    white-space: nowrap;
}

.nav-brand-subtitle {
    color: var(--muted);
    font-size: 0.73rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Right side */
.nav-actions {
    flex-shrink: 0;
}

/* User pill */
.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    padding: 5px 14px 5px 5px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}

    .user-pill:hover {
        background: rgba(255, 255, 255, 0.05);
        border-color: var(--border-light);
    }

    .user-pill[aria-expanded="true"] {
        background: rgba(37, 99, 235, 0.14);
        border-color: rgba(96, 165, 250, 0.45);
    }

    .user-pill::after {
        display: none !important;
    }

.user-avatar-badge {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: 1px solid rgba(147, 197, 253, 0.35);
    border-radius: 50%;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.user-name {
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 650;
    line-height: 1.25;
}

.user-role-badge {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.toggle-arrow {
    font-size: 0.68rem;
    color: var(--muted);
    transition: var(--transition);
}

.user-pill[aria-expanded="true"] .toggle-arrow {
    transform: rotate(180deg);
}

/* User dropdown */
.custom-dropdown {
    background: var(--panel);
    border: 1px solid var(--border-light) !important;
    border-radius: var(--radius-lg) !important;
    padding: 8px;
    margin-top: 10px !important;
    box-shadow: var(--shadow-lg) !important;
    min-width: 262px;
    animation: fadeInUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown-header-custom {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
}

.dropdown-user-name {
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.3;
}

.dropdown-user-role {
    color: #60a5fa;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Login account inside the dropdown */
.dropdown-user-account {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 500;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    line-height: 1.3;
}

    .dropdown-user-account i {
        color: var(--muted);
        font-size: 0.8rem;
    }

.dropdown-header-custom small,
.dropdown-header-custom span,
.dropdown-header-custom p {
    color: var(--muted) !important;
}

.dropdown-header-custom .user-name {
    color: white !important;
    font-weight: 600;
}

.dropdown-divider-custom {
    border-color: var(--border);
    margin: 4px 0;
}

.custom-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

    .custom-dropdown-item i {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 26px;
        height: 26px;
        flex-shrink: 0;
        border-radius: 8px;
        background: var(--primary-glow);
        color: var(--primary-soft);
        font-size: 0.85rem;
        transition: var(--transition);
    }

    .custom-dropdown-item:hover {
        background: var(--primary-glow);
        color: var(--primary-soft);
        transform: translateX(2px);
    }

        .custom-dropdown-item:hover i {
            background: var(--gradient-primary);
            color: white;
        }

    .custom-dropdown-item.logout-action i {
        background: var(--danger-glow);
        color: var(--danger);
    }

    .custom-dropdown-item.logout-action:hover {
        background: var(--danger-glow);
        color: var(--danger);
    }

        .custom-dropdown-item.logout-action:hover i {
            background: var(--danger);
            color: white;
        }


/* =====================================================================
   05. PAGE HEADER AND TOOLBAR
   ===================================================================== */
.page-header-modern {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto 24px;
    padding: 22px 26px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

    .page-header-modern::after {
        content: "";
        position: absolute;
        width: 180px;
        height: 180px;
        right: -70px;
        top: -100px;
        background: rgba(59, 130, 246, 0.18);
        border-radius: 50%;
        pointer-events: none;
    }

.page-header-start {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Header actions (badge, buttons): above the decorative circle */
.page-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.page-icon {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.25), rgba(6, 182, 212, 0.12));
    border: 1px solid rgba(96, 165, 250, 0.28);
    color: #93c5fd;
    font-size: 1.75rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: var(--transition-spring);
}

.page-header-modern:hover .page-icon {
    transform: rotate(-4deg) scale(1.05);
}

.page-title-container h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.15rem, 1.7vw + 0.8rem, 1.5rem);
    font-weight: 750;
    letter-spacing: -0.025em;
}

.page-title-container p {
    margin: 5px 0 0;
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Toolbar */
.toolbar-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 24px;
    margin-bottom: 24px;
}

/* Search + filters, grouped on the left side of the toolbar (always one row) */
.toolbar-filters {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

/* Aligned to the left edge (the global form rule centers it with margin: 0 auto) */
.toolbar-modern .input-group {
    flex: 1 1 260px;
    max-width: 460px;
    min-width: 0;
    margin: 0;
}

.toolbar-filters .filter-drop {
    flex: 0 0 auto;
}

/* --- "Filtros" button with a drop-down panel (native <details>) --- */
.filter-drop {
    position: relative;
}

.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 16px;
    background: var(--panel-2);
    border: 1px solid var(--border-light);
    border-radius: 9px;
    color: var(--text-soft);
    font-size: 0.85rem;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
    list-style: none;
    transition: var(--transition);
}

    .filter-toggle::-webkit-details-marker {
        display: none;
    }

    .filter-toggle:hover {
        background: var(--panel-3);
        color: var(--text);
    }

.filter-drop[open] .filter-toggle {
    background: var(--panel-3);
    border-color: #2563eb;
    color: var(--text);
}

.filter-chevron {
    font-size: 0.7rem;
    transition: var(--transition);
}

.filter-drop[open] .filter-chevron {
    transform: rotate(180deg);
}

/* Number of filters currently applied */
.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #2563eb;
    border-radius: 999px;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
}

/* The panel itself */
.filter-panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 300px;
    padding: 16px;
    background: var(--panel);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

    .filter-panel label {
        margin-bottom: 6px;
    }

    .filter-panel .status-filter {
        width: 100%;
        min-width: 0;
    }

.filter-panel-actions {
    display: flex;
    justify-content: flex-end;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

    .toolbar-actions .btn-secondary-modern {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        min-height: 40px;
        padding: 8px 16px;
        white-space: nowrap;
    }

        .toolbar-actions .btn-secondary-modern i {
            font-size: 0.9rem;
        }

    .toolbar-actions .btn-new {
        min-height: 40px;
        white-space: nowrap;
    }
