/* ═══════════════════════════════════════════════════════════
   DASHBOARD TOP-BAR — Automated Worx
   Slim navbar for authenticated dashboard pages
   Works with sidebar-shared.css for full dashboard layout
   ═══════════════════════════════════════════════════════════ */

/* ══ ISOLATION: prevent page styles from leaking in ═════ */
.navbar-dashboard,
.navbar-dashboard *,
.navbar-dashboard *::before,
.navbar-dashboard *::after {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.5;
    letter-spacing: normal;
    text-transform: none;
    font-style: normal;
    box-sizing: border-box;
}
.navbar-dashboard a         { text-decoration: none; outline: none; }
.navbar-dashboard button    { font-family: inherit; }

/* ── Top Bar ─────────────────────────────────────────── */
.navbar-dashboard {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    height: 56px;
    background: rgba(10, 15, 36, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(14, 242, 255, 0.1);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
}

.nd-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
}

/* ── Left: Toggle + Brand ────────────────────────────── */
.nd-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nd-sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid rgba(14, 242, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 1.1rem;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.nd-sidebar-toggle:hover {
    color: #0ef;
    border-color: rgba(14, 242, 255, 0.3);
    background: rgba(14, 242, 255, 0.05);
}

.nd-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #f8fafc;
    font-weight: 600;
    font-size: 1rem;
}

.nd-brand img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.nd-brand-text {
    background: linear-gradient(135deg, #0ef 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 0.95rem;
}

/* ── Center: Page breadcrumb ─────────────────────────── */
.nd-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.85rem;
}

.nd-breadcrumb span {
    color: #94a3b8;
}

.nd-breadcrumb .nd-page-title {
    color: #e2e8f0;
    font-weight: 500;
}

/* ── Right: User menu ────────────────────────────────── */
.nd-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nd-notifications {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid rgba(14, 242, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 1rem;
    transition: color 0.2s, border-color 0.2s;
}

.nd-notifications:hover {
    color: #0ef;
    border-color: rgba(14, 242, 255, 0.25);
}

.nd-notifications .nd-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #0a0f24;
}

.nd-user-menu {
    position: relative;
}

.nd-user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid rgba(14, 242, 255, 0.1);
    border-radius: 8px;
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.nd-user-btn:hover {
    border-color: rgba(14, 242, 255, 0.25);
    background: rgba(14, 242, 255, 0.03);
}

.nd-avatar {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: linear-gradient(135deg, #0ef 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #020617;
    font-size: 0.75rem;
    font-weight: 700;
}

.nd-user-name {
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 500;
}

.nd-user-arrow {
    color: #64748b;
    font-size: 0.6rem;
    transition: transform 0.2s;
}

/* User dropdown */
.nd-user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(10, 15, 36, 0.98);
    border: 1px solid rgba(14, 242, 255, 0.15);
    border-radius: 10px;
    min-width: 200px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    padding: 0.5rem;
    z-index: 1002;
    animation: ndSlideDown 0.15s ease;
}

@keyframes ndSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nd-user-dropdown.open {
    display: block;
}

.nd-user-dropdown a,
.nd-user-dropdown button {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 6px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.nd-user-dropdown a:hover,
.nd-user-dropdown button:hover {
    background: rgba(14, 242, 255, 0.08);
    color: #f8fafc;
}

.nd-user-dropdown .nd-divider {
    height: 1px;
    background: rgba(14, 242, 255, 0.1);
    margin: 0.35rem 0;
}

.nd-user-dropdown .nd-logout {
    color: #ef4444;
}

.nd-user-dropdown .nd-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1024px) {
    .nd-sidebar-toggle {
        display: flex;
    }

    .nd-breadcrumb {
        display: none;
    }
}

@media (max-width: 640px) {
    .nd-brand-text {
        display: none;
    }

    .nd-user-name {
        display: none;
    }
}
