/* TwoPixels Dashboard - Header v4 */
/* Hover Dropdowns Desktop + Expandable Mobile */

/* ========== NAVBAR ========== */
.tp-navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 56px !important;
    background: #0f172a !important;
    padding: 0 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    z-index: 9000 !important;
    border-bottom: 1px solid #334155 !important;
    box-sizing: border-box !important;
}

body {
    padding-top: 56px !important;
}

/* ========== BRAND ========== */
.tp-brand {
    font-size: 1.1em;
    font-weight: 700;
    color: white !important;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}
.tp-brand span { color: #3b82f6 !important; }

/* ========== DESKTOP NAV ========== */
.tp-desktop {
    display: none !important;
    align-items: center !important;
    gap: 2px !important;
    margin-left: auto !important;
}

@media (min-width: 1100px) {
    .tp-desktop { display: flex !important; }
    .tp-hamburger { display: none !important; }
}

/* Top-level nav link (no dropdown) */
.tp-desktop .nav-link {
    color: #94a3b8 !important;
    text-decoration: none !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    font-size: 0.85em !important;
    white-space: nowrap !important;
    transition: all 0.15s !important;
    display: block !important;
}
.tp-desktop .nav-link:hover {
    background: #334155 !important;
    color: white !important;
}
.tp-desktop .nav-link.active {
    background: #3b82f6 !important;
    color: white !important;
}

/* ========== DROPDOWN WRAPPER ========== */
.dd-wrap {
    position: relative !important;
}

/* Invisible bridge between trigger and menu so hover doesn't break */
.dd-wrap::after {
    content: '' !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    height: 12px !important;
    display: none !important;
}
.dd-wrap:hover::after {
    display: block !important;
}

.dd-trigger {
    color: #94a3b8 !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    font-size: 0.85em !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: all 0.15s !important;
    user-select: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}
.dd-trigger:hover,
.dd-wrap:hover .dd-trigger {
    background: #334155 !important;
    color: white !important;
}
.dd-trigger.dd-active {
    color: #60a5fa !important;
}

.dd-arrow {
    font-size: 0.7em !important;
    margin-left: 2px !important;
    transition: transform 0.2s !important;
}
.dd-wrap:hover .dd-arrow {
    transform: rotate(180deg) !important;
}

/* ========== DROPDOWN MENU ========== */
.dd-menu {
    display: none !important;
    position: absolute !important;
    top: calc(100% + 4px) !important;
    left: 0 !important;
    min-width: 200px !important;
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 8px !important;
    padding: 6px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4) !important;
    z-index: 9999 !important;
}

.dd-wrap:hover .dd-menu {
    display: block !important;
}

.dd-item {
    display: block !important;
    color: #94a3b8 !important;
    text-decoration: none !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    font-size: 0.85em !important;
    white-space: nowrap !important;
    transition: all 0.15s !important;
}
.dd-item:hover {
    background: #334155 !important;
    color: white !important;
}
.dd-item.active {
    background: #3b82f6 !important;
    color: white !important;
}

/* ========== HAMBURGER ========== */
.tp-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 15px;
    margin: -15px;
    position: relative;
    z-index: 100001 !important;
}
.tp-hamburger span {
    width: 24px;
    height: 2px;
    background: #e2e8f0;
    transition: all 0.3s;
    display: block;
}
.tp-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.tp-hamburger.open span:nth-child(2) { opacity: 0; }
.tp-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ========== MOBILE OVERLAY ========== */
.tp-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    right: 0 !important; bottom: 0 !important;
    background: rgba(0,0,0,0.7) !important;
    z-index: 99999 !important;
}
.tp-overlay.open { display: block !important; }

/* ========== MOBILE MENU ========== */
.tp-mobile {
    display: none;
    position: fixed !important;
    top: 56px !important;
    left: 0 !important; right: 0 !important; bottom: 0 !important;
    background: #0f172a !important;
    flex-direction: column !important;
    padding: 15px !important;
    gap: 4px !important;
    z-index: 100000 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}
.tp-mobile.open { display: flex !important; }

@media (min-width: 1100px) {
    .tp-mobile, .tp-overlay { display: none !important; }
}

/* Mobile top-level link */
.mob-link {
    display: block !important;
    color: #94a3b8 !important;
    text-decoration: none !important;
    padding: 12px 15px !important;
    border-radius: 8px !important;
    font-size: 0.95em !important;
    transition: all 0.15s !important;
}
.mob-link:hover, .mob-link:active {
    background: #334155 !important;
    color: white !important;
}
.mob-link.active {
    background: #3b82f6 !important;
    color: white !important;
}
.mob-link.top {
    font-weight: 600;
}

/* ========== MOBILE GROUPS ========== */
.mob-group {
    margin-bottom: 2px;
}

.mob-title {
    color: #94a3b8 !important;
    padding: 12px 15px !important;
    font-size: 0.95em !important;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
    background: #1e293b;
    user-select: none;
    transition: all 0.15s;
}
.mob-title:hover {
    background: #334155;
    color: white !important;
}

.mob-arrow {
    font-size: 0.7em;
    transition: transform 0.2s;
    color: #64748b;
}

.mob-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 10px;
}
.mob-items.open {
    max-height: 500px;
}

/* ========== LOGOUT BUTTON ========== */
.tp-logout {
    background: none !important;
    border: none !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    font-size: 0.9em !important;
    transition: all 0.15s !important;
    white-space: nowrap !important;
}
.tp-logout:hover {
    background: #ef4444 !important;
    color: white !important;
}

/* Mobile logout */
.tp-mobile .tp-logout {
    background: #ef4444 !important;
    color: white !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    font-size: 0.95em !important;
    width: 100%;
    text-align: center;
}
.tp-mobile .tp-logout:hover {
    background: #dc2626 !important;
}

/* ========== BREADCRUMB ========== */
.tp-breadcrumb {
    background: #1e293b !important;
    border-bottom: 1px solid #334155 !important;
    padding: 8px 20px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 0.85em !important;
    flex-wrap: wrap !important;
}
.tp-bc-link {
    color: #94a3b8 !important;
    text-decoration: none !important;
    transition: color 0.15s !important;
}
.tp-bc-link:hover {
    color: #e2e8f0 !important;
}
.tp-bc-sep {
    color: #475569 !important;
    font-size: 0.9em !important;
}
.tp-bc-current {
    color: #e2e8f0 !important;
    font-weight: 600 !important;
}

/* ========== SCROLLBAR ========== */
.tp-mobile::-webkit-scrollbar { width: 6px; }
.tp-mobile::-webkit-scrollbar-track { background: #1e293b; }
.tp-mobile::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }
