/* ============================================================
   Navigation History / Activity Panel — Dark Glass Theme
   ============================================================ */

/* Backdrop overlay */
.nav-history-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1040;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.nav-history-overlay.active {
    display: block;
    opacity: 1;
}

/* Slide-in Panel */
.nav-history-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 100vw;
    height: 100%;
    background: var(--bg-secondary, #1e293b);
    border-left: 1px solid var(--glass-border, rgba(255,255,255,0.1));
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.4);
    z-index: 1050;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.nav-history-panel.open {
    right: 0;
}

/* Panel Header */
.nav-history-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--glass-border, rgba(255,255,255,0.1));
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg, rgba(255,255,255,0.05));
    flex-shrink: 0;
}
.nav-history-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #f8fafc);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-history-header h3::before {
    content: '\f1da'; /* fa-history */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--accent-primary, #38bdf8);
    font-size: 0.875rem;
}
.nav-history-close {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary, #94a3b8);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.nav-history-close:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary, #f8fafc);
}

/* Search + Clear Controls */
.nav-history-controls {
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--glass-border, rgba(255,255,255,0.1));
    flex-shrink: 0;
}
.nav-history-controls input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--input-bg, rgba(255,255,255,0.05));
    border: 1px solid var(--input-border, rgba(255,255,255,0.1));
    border-radius: 0.5rem;
    color: var(--text-primary, #f8fafc);
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s ease;
}
.nav-history-controls input::placeholder {
    color: var(--text-muted, #64748b);
}
.nav-history-controls input:focus {
    border-color: var(--input-focus, #38bdf8);
    box-shadow: 0 0 0 3px var(--input-focus-ring, rgba(56,189,248,0.1));
}
.btn-clear {
    background: rgba(251,113,133,0.15);
    color: #fb7185;
    border: 1px solid rgba(251,113,133,0.3);
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.btn-clear:hover {
    background: rgba(251,113,133,0.25);
    border-color: rgba(251,113,133,0.5);
}

/* Scrollable List */
.nav-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.nav-history-list::-webkit-scrollbar { width: 4px; }
.nav-history-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* Empty State */
.nav-empty {
    text-align: center;
    color: var(--text-muted, #64748b);
    margin-top: 3rem;
    font-size: 0.875rem;
}

/* History Item */
.nav-history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.375rem;
    background: var(--glass-bg, rgba(255,255,255,0.04));
    border: 1px solid var(--glass-border, rgba(255,255,255,0.06));
    border-radius: 0.625rem;
    text-decoration: none;
    color: var(--text-primary, #f8fafc);
    transition: all 0.2s ease;
}
.nav-history-item:hover {
    background: var(--glass-hover, rgba(255,255,255,0.08));
    border-color: rgba(255,255,255,0.12);
    transform: translateX(-3px);
}
.nav-history-item.current {
    border-left: 3px solid var(--accent-primary, #38bdf8);
    background: var(--accent-light, rgba(56,189,248,0.08));
}

/* Module Badge */
.nav-item-module {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    color: white;
    background: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    min-width: 3rem;
    text-align: center;
}
.badge-tenants   { background: #2563eb; }
.badge-admin     { background: #dc2626; }
.badge-settings  { background: #16a34a; }
.badge-dashboard { background: #0891b2; }
.badge-crm       { background: #7c3aed; }
.badge-finance   { background: #d97706; }
.badge-hr        { background: #059669; }
.badge-inventory { background: #0284c7; }
.badge-sales     { background: #9333ea; }

/* Item Content */
.nav-item-details {
    flex: 1;
    overflow: hidden;
}
.nav-item-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary, #f8fafc);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.15rem;
}
.nav-item-meta {
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-duration {
    background: rgba(255,255,255,0.08);
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.65rem;
    color: var(--text-secondary, #94a3b8);
}
