.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 -30px 30px -30px;
    padding: 16px 30px 40px;
    position: sticky;
    top: 0;
    z-index: 40;
}
/* Blur/background dipisah ke pseudo-element sendiri (bukan langsung di .navbar)
   supaya mask fade di bawah ini cuma motong lapisan background-nya doang —
   kalau ditaruh langsung di .navbar, notif/profile/chat dropdown (anak DOM
   .navbar juga, muncul di luar kotak navbar) ikut ke-mask/terpotong aneh. */
.navbar::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: color-mix(in srgb, var(--background) 35%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    backdrop-filter: blur(14px) saturate(150%);
    /* Backdrop-filter selalu berhenti tegas di tepi box — mask ini yang bikin
       transisinya luruh halus ke konten di bawah, alih-alih keliatan garis/kotak. */
    mask-image: linear-gradient(to bottom, #000 0%, #000 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 50%, transparent 100%);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navbar-left h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.navbar-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 9px;
    font-size: 15px;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 14%, transparent);
}

.navbar-left p {
    font-size: 12px;
    color: var(--text-light);
    margin: 0;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

/* ── AKSI CEPAT (bungkus ikon navbar untuk mobile) ───────────────────────────
   DESKTOP: .navbar-actions = display:contents -> tombol tema/musik/chat/notif
   di dalamnya mengalir inline di navbar-right PERSIS seperti sebelumnya (tidak
   ada perubahan tampilan desktop), dan tombol pemicu disembunyikan.
   MOBILE (@media max-width:600px di bawah): .navbar-actions berubah jadi popup
   yang muncul saat tombol pemicu di-tap. */
.navbar-actions { display: contents; }

.navbar-actions-toggle {
    display: none;              /* hanya muncul di mobile (lihat @media di bawah) */
    position: relative;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--text-light);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    transition: background .2s, color .2s, transform .15s;
}
.navbar-actions-toggle:hover { background: var(--surface-3); color: var(--primary); }
.navbar-actions-toggle.active { background: var(--surface-3); color: var(--primary); transform: rotate(90deg); }

/* Titik penanda: ada notif/chat belum dibaca yang "tersembunyi" di dalam popup. */
.navbar-actions-dot {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid var(--surface);
}

/* ── TANGGAL ── */
.navbar-date {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
    white-space: nowrap;
}

/* ── TOGGLE MODE MALAM ── */
.theme-toggle {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--navbar-bg);
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: var(--text-light);
    transition: background .2s, color .2s, transform .2s;
    flex-shrink: 0;
}
.theme-toggle:hover { background: var(--surface-3); color: var(--primary); transform: translateY(-1px); }
.theme-toggle .theme-icon-light { display: none; }
.theme-toggle .theme-icon-dark  { display: inline; }

/* ── NOTIFIKASI ── */
.notification {
    position: relative;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, transform .15s, box-shadow .2s;
}
.notification:hover { background: var(--surface-3); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(15,23,42,.14); }
.notification:active { transform: translateY(0); }

/* Pulse halus saat ada notif belum dibaca — narik perhatian tanpa berisik. */
.notification.has-unread { animation: notif-pulse 1.8s ease-in-out infinite; }
@keyframes notif-pulse {
    0%, 100% { box-shadow: var(--shadow); }
    50%      { box-shadow: 0 0 0 6px rgba(37, 99, 235, .15); }
}
/* Ada unread severity=urgent -> pulse lebih cepat & ring amber, menang atas pulse biasa. */
.notification.has-unread-urgent { animation: notif-pulse-urgent 1.1s ease-in-out infinite; }
@keyframes notif-pulse-urgent {
    0%, 100% { box-shadow: var(--shadow); }
    50%      { box-shadow: 0 0 0 6px rgba(245, 158, 11, .35); }
}
/* Micro-dot prioritas — muncul di pojok bell kalau ada unread mendesak. */
.notif-urgent-dot {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #f59e0b;
    border: 2px solid var(--surface);
}

/* ── CHAT (navbar) ── */
.navbar-chat-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 16px;
    text-decoration: none;
    transition: background .2s, color .2s;
    flex-shrink: 0;
}
.navbar-chat-btn:hover { background: var(--surface-3); color: var(--primary); }

.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    padding: 0 4px;
}

/* ── NOTIF DROPDOWN ── */
.notif-wrap { position: relative; }

.notif-dropdown {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    width: 408px;
    max-width: calc(100vw - 32px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .18), 0 4px 14px rgba(15, 23, 42, .08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(.98);
    transform-origin: top right;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    /* Di atas dock popup chat (.cmw-dock z-index:250) — dropdown lonceng yang baru
       dibuka harus menang atas jendela chat mengambang. */
    z-index: 260;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.notif-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

/* Mobile: dropdown jadi bottom sheet full-screen (bukan cuma width-clamp).
   Breakpoint disamakan ke 600px = ambang popup .navbar-actions, supaya saat
   ikon lonceng dibuka dari dalam popup, panelnya ber-anchor ke viewport
   (bottom sheet) bukan nempel ke tombol di dalam popup. */
@media (max-width: 600px) {
    .notif-dropdown {
        position: fixed;
        inset: auto 0 0 0;
        top: auto;
        width: 100%;
        max-width: 100%;
        border-radius: 18px 18px 0 0;
        max-height: 82vh;
        transform: translateY(100%);
        transition: opacity .2s ease, transform .22s ease-out, visibility .2s;
    }
    .notif-dropdown.show { transform: translateY(0); }
    .notif-list { max-height: none; flex: 1 1 auto; }
    .notif-dismiss { opacity: 1 !important; }
}

.notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 16px;
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.notif-head-title { display: flex; align-items: center; gap: 8px; }
.notif-head strong { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -.1px; }
.notif-head-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}
.notif-head button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-light);
    font-family: "Poppins", sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s;
}
.notif-head button i { font-size: 13px; }
.notif-head button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.notif-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.notif-list::-webkit-scrollbar { width: 6px; }
.notif-list::-webkit-scrollbar-track { background: transparent; }
.notif-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.notif-list::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* Base dipakai bersama Notification Center (#nc-list .notif-item, lihat
   notifikasi-center.css) — TETAP dipertahankan persis biar halaman itu gak ikut
   berubah. Redesign kartu modern di bawah sengaja di-scope ke ".notif-dropdown
   .notif-item" doang, cuma berlaku di popup lonceng navbar. */
.notif-item {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 12px 40px 12px 18px;
    border-bottom: 1px solid var(--surface-3);
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: background .15s;
}
.notif-item:hover { background: var(--surface-2); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: #eff6ff; }
.notif-item.unread:hover { background: #e0ecff; }

/* Priority rail — terpisah dari warna ikon per-tipe, menandai urgensi. */
.notif-item.severity-urgent { border-left-color: #ef4444; }
.notif-item.severity-normal { border-left-color: transparent; }
.notif-item.severity-info   { border-left-color: #cbd5e1; }

/* Transisi keluar saat di-dismiss. */
.notif-item.notif-item-removing { opacity: 0; transform: translateX(12px); pointer-events: none; transition: opacity .15s, transform .15s; }

/* ── Redesign kartu modern — CUMA di dalam popup dropdown navbar ── */
.notif-dropdown .notif-item {
    border-radius: 12px;
    border: 1px solid transparent;
    border-bottom: none;
    padding: 11px 36px 11px 12px;
    transition: background .15s, border-color .15s, transform .1s;
}
.notif-dropdown .notif-item:last-child { border-bottom: none; }
.notif-dropdown .notif-item:active { transform: scale(.99); }
.notif-dropdown .notif-item.unread { background: rgba(37,99,235,.05); border-color: rgba(37,99,235,.14); }
.notif-dropdown .notif-item.unread:hover { background: rgba(37,99,235,.09); }
.notif-dropdown .notif-item.severity-urgent,
.notif-dropdown .notif-item.severity-info { border-left-color: transparent; } /* diganti accent bar bulat di bawah */
.notif-dropdown .notif-item.severity-urgent::before,
.notif-dropdown .notif-item.severity-info::before {
    content: '';
    position: absolute;
    left: 3px; top: 10px; bottom: 10px;
    width: 3px;
    border-radius: 3px;
}
.notif-dropdown .notif-item.severity-urgent::before { background: #ef4444; }
.notif-dropdown .notif-item.severity-info::before   { background: #cbd5e1; }

.notif-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    background: var(--surface-3);
    color: var(--text-light);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}
/* warna ikon per tipe */
.notif-akun     .notif-icon { background: #eff6ff; color: #2563eb; }
.notif-stok     .notif-icon { background: #fef2f2; color: #dc2626; }
.notif-finance  .notif-icon { background: #f0fdf4; color: #16a34a; }
.notif-gudang   .notif-icon { background: #fefce8; color: #ca8a04; }
.notif-produksi .notif-icon { background: #eef2ff; color: #4f46e5; }
.notif-bug      .notif-icon { background: #fdf2f8; color: #db2777; }
.notif-gaji     .notif-icon { background: #f0fdfa; color: #0d9488; }
.notif-permintaan_vendor .notif-icon { background: #fff7ed; color: #ea580c; }

.notif-body { min-width: 0; flex: 1; padding-top: 1px; }
.notif-title-row { display: flex; align-items: center; gap: 6px; }
.notif-title { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.35; }
.notif-unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.notif-msg {
    font-size: 12.5px;
    color: var(--text-light);
    margin: 3px 0 5px;
    line-height: 1.5;
}
.notif-time { font-size: 11px; color: #94a3b8; }

/* Dismiss (hapus/arsip) — muncul on-hover desktop, selalu tampil mobile (lihat media query). */
.notif-dismiss {
    position: absolute;
    top: 9px;
    right: 8px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    opacity: 0;
    transition: opacity .15s, background .15s, color .15s;
}
.notif-item:hover .notif-dismiss { opacity: 1; }
.notif-dismiss:hover { background: rgba(239,68,68,.12); color: #dc2626; }

/* Aksi inline (Setuju/Tolak) — dibatasi ke event transaksi.pending_approval. */
.notif-inline-actions { display: flex; gap: 8px; margin-top: 8px; }
.notif-act {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 5px 12px;
    font-family: "Poppins", sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.notif-act:disabled { opacity: .5; cursor: not-allowed; }
.notif-act-approve { color: #16a34a; }
.notif-act-approve:hover:not(:disabled) { background: #16a34a; color: #fff; border-color: #16a34a; }
.notif-act-reject { color: #dc2626; }
.notif-act-reject:hover:not(:disabled) { background: #dc2626; color: #fff; border-color: #dc2626; }

/* Skeleton loading (dropdown dibuka, sebelum fetch pertama selesai). */
.notif-item.notif-skeleton { cursor: default; }
.notif-item.notif-skeleton:hover { background: transparent; }
.notif-skeleton-block, .notif-skeleton-line {
    background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
    background-size: 200% 100%;
    animation: notif-shimmer 1.4s ease-in-out infinite;
    border-radius: 6px;
}
.notif-skeleton-line { height: 10px; margin: 6px 0; }
@keyframes notif-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.notif-empty {
    padding: 46px 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.notif-empty i {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface-3);
    font-size: 24px;
    color: var(--text-light);
    opacity: .85;
}

.notif-footer {
    border-top: 1px solid var(--border);
    padding: 10px;
    flex-shrink: 0;
}
.notif-footer a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 10px;
    transition: background .15s, color .15s;
}
.notif-footer a:hover { background: var(--surface-2); color: var(--primary); }

/* ── PROFILE ── */
.profile {
    display: flex;
    align-items: center;
    gap: 11px;
    cursor: pointer;
    padding: 5px 12px 5px 6px;
    border-radius: 14px;
    border: 1px solid transparent;
    transition: background .2s, border-color .2s;
    user-select: none;
}
.profile:hover { background: var(--surface-3); border-color: var(--border); }

/* Avatar monogram (inisial nama) */
.profile-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    box-shadow: 0 4px 12px rgba(37,99,235,.35);
    flex-shrink: 0;
}
.profile-avatar.lg { width: 46px; height: 46px; font-size: 19px; }

/* Bila user punya foto profil, avatar menampilkan gambar (menutupi monogram). */
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-status {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #22c55e;
    border: 2.5px solid var(--background);
}

.profile-meta { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; min-width: 0; }
.profile-meta h4 {
    font-size: 13px;
    font-weight: 700;
    margin: 0;
    color: var(--text-dark);
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-role {
    font-size: 10px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.profile-chevron {
    font-size: 11px;
    color: var(--text-light);
    transition: transform .25s, color .2s;
    margin-left: 2px;
}
.profile-chevron.rotated { transform: rotate(180deg); color: var(--primary); }

/* ── PROFILE DROPDOWN ── */
.profile-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15,23,42,.12);
    z-index: 999;
    overflow: hidden;
    animation: dropdownFade .15s ease;
}
.profile-dropdown.open { display: block; }

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface-2);
}
/* avatar header dropdown memakai .profile-avatar.lg */
.profile-dropdown-header strong {
    font-size: 13px;
    font-weight: 600;
    display: block;
    color: var(--text-dark);
}
.profile-dropdown-header span {
    font-size: 11px;
    color: var(--text-light);
}

.profile-dropdown hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0;
}

.profile-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    text-decoration: none;
    transition: background .15s;
}
.profile-dropdown a:hover { background: var(--surface-3); }
.profile-dropdown a:last-child { color: #ef4444; }
.profile-dropdown a:last-child:hover { background: rgba(239,68,68,.1); }
.profile-dropdown a i { font-size: 15px; width: 18px; text-align: center; }

/* ── NAVBAR MODE TAMU (belum login, preview beranda) ── */
.navbar-guest-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-dark);
}
.navbar-guest-brand img { height: 34px; width: auto; }
/* Swap logo sesuai tema: hitam di terang, putih di gelap (default = terang). */
.navbar-guest-logo-dark { display: none; }
html[data-theme="dark"] .navbar-guest-logo-light { display: none; }
html[data-theme="dark"] .navbar-guest-logo-dark { display: inline; }
.navbar-guest-brand span { font-size: 16px; font-weight: 600; letter-spacing: .2px; }
.navbar-guest-brand span b { font-weight: 800; }

.navbar-guest-login,
.navbar-guest-register {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 11px;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s, transform .15s, box-shadow .2s;
    white-space: nowrap;
}
.navbar-guest-login {
    color: var(--text-dark);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.navbar-guest-login:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-1px); }
.navbar-guest-register {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    border: 1px solid transparent;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .35);
}
.navbar-guest-register:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(37, 99, 235, .5); }

/* Di layar sempit, ringkas tombol tamu supaya tidak menabrak brand. */
@media (max-width: 560px) {
    .navbar-guest-brand span { display: none; }
    .navbar-guest-login,
    .navbar-guest-register { padding: 9px 14px; }
}

/* ── MENU TOGGLE BUTTON ── */
#menu-toggle {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-dark);
    transition: background .2s;
}
#menu-toggle:hover { background: var(--surface-3); }

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE (mobile / jendela PWA)
   Sengaja ditaruh DI AKHIR file: sejumlah override di sini (mis. .profile-meta
   display:none, ukuran tombol) menargetkan properti yang juga di-set aturan
   dasar komponen di atas. Karena specificity sama, yang MENANG = yang muncul
   terakhir di sumber. Kalau blok ini dipindah ke atas, override-nya diam-diam
   mati lagi (bug 2026-07-23: nama profil tetap tampil di HP).
   ════════════════════════════════════════════════════════════════════════════ */

/* Navbar DIJAGA TETAP SATU BARIS. Dulu flex-wrap:wrap -> deretan kanan (tombol
   + tanggal + profil) turun ke baris kedua. Sekarang: judul menyusut+ellipsis,
   deretan tombol kanan tidak pernah wrap, elemen non-esensial (tanggal, lalu
   teks nama/role profil) disembunyikan bertahap supaya muat sebaris. */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: nowrap;
        gap: 12px;
    }
    .navbar-left {
        min-width: 0;
        flex: 1 1 auto;
        gap: 12px;
    }
    .navbar-left > button { flex-shrink: 0; }
    .navbar-left > div {
        min-width: 0;
        flex: 1 1 auto;
    }
    .navbar-left h1,
    .navbar-left p {
        min-width: 0;
    }
    .navbar-left .navbar-title-text,
    .navbar-left p {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .navbar-right {
        gap: 8px;
        margin-left: auto;
        flex-wrap: nowrap;
        flex-shrink: 0;
    }
    /* Tanggal redundant di bar atas mobile — sembunyikan lebih awal. */
    .navbar-date { display: none; }
}

/* Lebih sempit lagi (HP): profil = FOTO SAJA (tanpa nama/role/chevron) +
   tombol ikon sedikit lebih kecil, supaya deretan kanan ringkas & sebaris. */
@media (max-width: 600px) {
    .profile-meta { display: none; }
    .profile-chevron { display: none; }
    .profile { padding: 4px; gap: 0; }
    .navbar-right { gap: 6px; }
    .theme-toggle,
    .notification,
    .navbar-chat-btn,
    .navbar-music-btn {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }
    .profile-avatar { width: 36px; height: 36px; font-size: 14px; }

    /* Tampilkan tombol pemicu; ikon aksi (tema/musik/chat/notif) pindah ke
       dalam popup. Hasil di navbar mobile: [☰ judul] ...... [◍ pemicu] [avatar]. */
    .navbar-actions-toggle {
        display: inline-flex;
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    .navbar-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        position: absolute;
        top: calc(100% + 6px);
        right: 0;
        padding: 10px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 16px;
        box-shadow: 0 16px 44px rgba(15, 23, 42, .22);
        /* transform HANYA di state tertutup; saat .open -> transform:none supaya
           panel anak (notif/chat/musik yg position:fixed) tetap ber-anchor ke
           viewport, bukan ke popup ini. */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity .18s ease, transform .18s ease, visibility .18s;
        z-index: 60;
    }
    .navbar-actions.open {
        opacity: 1;
        visibility: visible;
        transform: none;
    }
}
