﻿/* =========================================================
   HUBSPOT-LIKE VARIABLES (CORRECTED)
   ========================================================= */
:root {
    --nav-bg: #0F3D2E; /* HubSpot main blue */
    --nav-bg-soft: #0F3D2E; /* Sidebar background */
    --nav-hover: #425b76; /* Hover row */
    --nav-accent: #ff7a59; /* HubSpot orange */
    --nav-text: #ffffff;
    --nav-muted: #cbd6e2;
    --navbar-height: 50px;
    --sidebar-collapsed: 56px;
    --sidebar-expanded: 260px;
    --sidebar-current: var(--sidebar-collapsed);
}

/* =========================================================
   TOP NAVBAR
   ========================================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: var(--navbar-height);
    background: var(--nav-bg);
    z-index: 1000;
    box-sizing: border-box;
}

.nav-container {
    width: 100%;
    max-width: none;
    height: 100%;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.nav-logo {
    font-size: 14px;
    font-weight: 700;
    color: var(--nav-text);
    text-decoration: none;
}

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1002;
    flex-shrink: 0;
}

/* Hide hamburger on desktop */
@media (min-width: 1025px) {
    .mobile-menu-btn {
        display: none;
    }
}

/* =========================================================
   USER DROPDOWN (FIXED)
   ========================================================= */
.user-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 1003;
}

.user-btn {
    height: 32px;
    padding: 0 12px;
    border-radius: 4px;
    background: rgba(255,255,255,0.12);
    border: none;
    color: var(--nav-text);
    font-size: 13px;
    cursor: pointer;
}

    .user-btn:hover {
        background: rgba(255,255,255,0.18);
    }

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 200px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    padding: 6px;
    z-index: 1001;
}

.dropdown-bridge {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    width: 100%;
    height: 10px;
    z-index: 1001;
}

.user-dropdown:hover .dropdown-content,
.user-dropdown:hover .dropdown-bridge,
.user-dropdown:focus-within .dropdown-content,
.user-dropdown:focus-within .dropdown-bridge {
    display: block;
}

.dropdown-content a,
.dropdown-content button {
    width: 100%;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 13px;
    background: none;
    border: none;
    color: #33475b;
    text-align: left;
    cursor: pointer;
}

    .dropdown-content a:hover,
    .dropdown-content button:hover {
        background: #f5f8fa;
    }

/* =========================================================
   SIDEBAR BASE
   ========================================================= */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-collapsed);
    height: calc(100vh - var(--navbar-height));
    background: var(--nav-bg-soft);
    transition: width 0.25s ease;
    overflow: visible;
    z-index: 900;
}

.admin-shell {
    min-height: 100vh;
    padding-top: var(--navbar-height);
    padding-left: var(--sidebar-collapsed);
    background: #f5f8fa;
}

.admin-shell-content {
    min-height: calc(100vh - var(--navbar-height));
    padding: 24px;
}

    .sidebar.expanded {
        width: var(--sidebar-expanded);
    }

.sidebar-content {
    padding: 8px 0;
}

/* =========================================================
   SIDEBAR SECTIONS / HEADERS
   ========================================================= */
.sidebar-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--nav-muted);
    text-transform: uppercase;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

.sidebar.expanded .sidebar-header {
    opacity: 1;
    height: auto;
    padding: 8px 16px;
}

/* =========================================================
   SIDEBAR LINKS (FIXED HOVER)
   ========================================================= */
.sidebar-link {
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--nav-muted);
    text-decoration: none;
    font-size: 13px;
    transition: background .15s ease, color .15s ease;
}

.sidebar.expanded .sidebar-link {
    justify-content: flex-start;
    padding: 0 16px;
}

.sidebar-link:hover {
    background: var(--nav-hover);
    color: var(--nav-text);
}

/* Accent bar */
.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 0;
    background: var(--nav-accent);
}

.sidebar-link:hover::before {
    width: 3px;
}

/* =========================================================
   ICONS (NO SIDEBAR COLOR BLEED)
   ========================================================= */
.sidebar-link .icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    stroke: currentColor;
    stroke-width: 1.75;
}

/* =========================================================
   LINK TEXT
   ========================================================= */
.link-text {
    white-space: nowrap;
}

/* Tooltip when collapsed */
.sidebar:not(.expanded) .link-text {
    display: none;
    position: absolute;
    left: 60px;
    background: #111;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
}

.sidebar:not(.expanded) .sidebar-link:hover .link-text {
    display: block;
}

/* =========================================================
   GROUP TITLES
   ========================================================= */
.sidebar-group-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--nav-muted);
    opacity: 0;
    height: 0;
    overflow: hidden;
}

.sidebar.expanded .sidebar-group-title {
    opacity: 1;
    height: auto;
    padding: 8px 16px;
}

/* =========================================================
   TOGGLE BUTTON (BOTTOM + NEUTRAL, SHOW ON HOVER)
   ========================================================= */
.sidebar-toggle-btn {
    position: absolute;
    bottom: 12px; /* back to bottom */
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    /* neutral, not orange */
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    /* hidden until hover */
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, background .15s ease, border-color .15s ease;
}

/* show ONLY when hovering sidebar */
.sidebar:hover .sidebar-toggle-btn {
    opacity: 1;
    pointer-events: auto;
}

/* hover */
.sidebar-toggle-btn:hover {
    background: rgba(255,255,255,0.16);
    border-color: rgba(255,255,255,0.26);
}

.toggle-icon {
    width: 18px;
    height: 18px;
    transition: transform .2s ease;
}

.sidebar.expanded .toggle-icon {
    transform: rotate(180deg);
}
/* =========================================================
   USER DROPDOWN – CONTENT (FIXED & STYLED)
   ========================================================= */

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 220px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    padding: 6px;
    z-index: 1001;
}

/* normalize ALL items inside dropdown */
.dropdown-content a,
.dropdown-content button {
    display: flex;
    align-items: center;
    width: 100%;
    height: 36px;
    padding: 0 12px;
    background: none;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #33475b;
    text-decoration: none;
    cursor: pointer;
    text-align: left;
}

    /* hover state */
    .dropdown-content a:hover,
    .dropdown-content button:hover {
        background: #f5f8fa;
    }

/* remove default button bullshit */
.dropdown-content button {
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

/* logout separator (HubSpot-style subtle divide) */
.dropdown-content form {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #e5e7eb;
}


/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 1024px) {
    .admin-shell {
        padding-left: 0;
    }

    .admin-shell-content {
        padding: 16px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-expanded);
    }

        .sidebar.open {
            transform: translateX(0);
        }
}
/* =========================================================
   HUBSPOT-STYLE PILL BADGE
   ========================================================= */

.nav-pill {
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-radius: 999px;
    background: rgba(255, 122, 89, 0.18); /* light HubSpot orange */
    color: var(--nav-accent);
    line-height: 1;
}

/* hide pill when sidebar is collapsed */
.sidebar:not(.expanded) .nav-pill {
    display: none;
}
/* =========================================================
   NOTIFICATIONS
   ========================================================= */

.nav-notifications {
    position: relative;
}

/* bell button */
.notif-btn {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255,255,255,0.12);
    border: none;
    color: var(--nav-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .notif-btn:hover {
        background: rgba(255,255,255,0.18);
    }

.notif-icon {
    width: 18px;
    height: 18px;
}

/* unread count */
.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--nav-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 0 0 2px #0f3d2e;
    pointer-events: none;
}

/* panel */
.notif-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 280px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    overflow: hidden;
    display: none;
    z-index: 1001;
}

.notif-panel-live {
    display: block;
}

/* open on hover desktop */
@media (min-width: 769px) {
    .nav-notifications:hover .notif-panel {
        display: block;
    }
}

/* header */
.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #33475b;
    border-bottom: 1px solid #e5e7eb;
}

.notif-header strong {
    font-size: 13px;
    font-weight: 700;
}

.notif-mark-all-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    font-weight: 700;
    color: #1d4ed8;
    cursor: pointer;
}

.notif-mark-all-btn:hover {
    text-decoration: underline;
}

/* list */
.notif-list {
    max-height: 320px;
    overflow-y: auto;
}

/* empty state */
.notif-empty {
    padding: 24px 12px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}

/* individual notification (future-ready) */
.notif-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    font-size: 13px;
    color: #33475b;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

    .notif-item:hover {
        background: #f5f8fa;
    }

.notif-item.is-unread {
    background: #f0f9ff;
}

.notif-item.is-unread:hover {
    background: #e0f2fe;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item-dot {
    width: 8px;
    height: 8px;
    margin-top: 5px;
    border-radius: 50%;
    background: #1d4ed8;
    flex-shrink: 0;
}

.notif-item-dot.is-read {
    background: transparent;
}

.notif-item-content {
    min-width: 0;
    flex: 1;
}

.notif-item-title {
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-message {
    margin-top: 2px;
    color: #64748b;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-time {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 11px;
}

.notif-footer {
    padding: 10px 12px;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

.notif-footer a {
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.notif-footer a:hover {
    text-decoration: underline;
}
/* SHOW notifications on hover (desktop) */
@media (min-width: 769px) {
    .nav-notifications:hover .notif-panel {
        display: block;
    }
}
/* =========================================================
   SIDEBAR NAV RAIL
   ========================================================= */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    gap: 2px;
    width: 100%;
}

/* =========================================================
   ICON BUTTONS
   ========================================================= */
.nav-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nav-muted);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

    .nav-icon-btn svg {
        width: 18px;
        height: 18px;
        stroke: currentColor;
    }

    .nav-icon-btn:hover,
    .nav-icon-btn.active {
        background: var(--nav-hover);
        color: var(--nav-text);
    }

    /* Tooltip for plain icon links (no flyout) */
    .nav-icon-btn[title]:not(.has-flyout)::after {
        content: attr(title);
        position: absolute;
        left: calc(100% + 10px);
        top: 50%;
        transform: translateY(-50%);
        background: #111c27;
        color: #fff;
        font-size: 12px;
        font-weight: 500;
        padding: 5px 10px;
        border-radius: 5px;
        white-space: nowrap;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.12s;
        z-index: 960;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }

    .nav-icon-btn[title]:not(.has-flyout):hover::after {
        opacity: 1;
    }

/* =========================================================
   FLYOUT GROUPS
   ========================================================= */
.flyout-group {
    position: relative;
}

    .flyout-group:hover .flyout-panel {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0);
    }

/* =========================================================
   FLYOUT PANEL
   ========================================================= */
.flyout-panel {
    position: absolute;
    left: calc(100% + 6px);
    top: 0;
    width: 220px;
    background: #0f3d2e;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.06);
    padding: 6px;
    z-index: 950;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

    /* Arrow pointing back to sidebar */
    .flyout-panel::before {
        content: '';
        position: absolute;
        left: -6px;
        top: 14px;
        border: 6px solid transparent;
        border-right-color: #0f3d2e;
        border-left: none;
    }

.flyout-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--nav-muted);
    padding: 6px 10px 4px;
    opacity: 0.7;
}

/* =========================================================
   FLYOUT LINKS
   ========================================================= */
.flyout-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    color: #a8c0d6;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}

    .flyout-link svg {
        width: 15px;
        height: 15px;
        stroke: currentColor;
        opacity: 0.7;
        flex-shrink: 0;
    }

    .flyout-link:hover {
        background: rgba(255,255,255,0.08);
        color: #ffffff;
    }

        .flyout-link:hover svg {
            opacity: 1;
        }

    .flyout-link::before {
        content: '';
        position: absolute;
        left: 0;
        top: 6px;
        bottom: 6px;
        width: 0;
        border-radius: 0 2px 2px 0;
        background: var(--nav-accent);
        transition: width 0.12s;
    }

    .flyout-link:hover::before {
        width: 3px;
    }

    .flyout-link.is-active {
        background: rgba(255,255,255,0.1);
        color: #ffffff;
    }

    .flyout-link.is-active::before {
        width: 3px;
    }

    .flyout-link.is-disabled {
        opacity: 0.42;
        pointer-events: none;
        cursor: not-allowed;
    }

/* =========================================================
   FLYOUT PILL BADGE
   ========================================================= */
.flyout-pill {
    margin-left: auto;
    padding: 2px 7px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 999px;
    background: rgba(255, 122, 89, 0.18);
    color: var(--nav-accent);
    line-height: 1.4;
}
