/* ==========================================================
   TOPBAR (page header) — dipakai bersama di semua halaman admin
   Cara pakai: <link rel="stylesheet" href="assets/topbar.css">
   ========================================================== */

.topbar {
    background: #ffffff;
    border-radius: 4px;
    padding: 14px 18px;
    margin-bottom: 18px;
    box-shadow: 0 3px 8px rgba(67, 89, 113, 0.16);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-menu,
.topbar-icon {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}

.topbar-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.topbar-logo img {
    height: 32px;
    width: auto;
    object-fit: contain;
    display: block;
}

.topbar-menu:hover,
.topbar-icon:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.topbar-search {
    width: 320px;
    height: 42px;
    background: #f8fafc;
    border: 1px solid #d8e3e8;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
}

.topbar-search i {
    color: #64748b;
    font-size: 14px;
}

.topbar-search input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: #0f172a;
    font-size: 14px;
}

.topbar-search input::placeholder {
    color: #94a3b8;
}

.topbar-date,
.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #d8e3e8;
    color: #475569;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
}

.topbar-user {
    cursor: pointer;
    font-family: inherit;
}

.topbar-date i,
.topbar-user i {
    color: #2563eb;
}

.user-caret {
    font-size: 10px;
    color: #94a3b8;
    margin-left: 2px;
}

/* ---------- Notifikasi lonceng ---------- */

.notif-wrap {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 0 0 2px #ffffff;
    pointer-events: none;
}

.notif-panel {
    display: none;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-height: 440px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.22);
    border: 1px solid #e5eaf1;
    z-index: 2000;
    overflow: hidden;
    color: #0f172a;
}

.notif-panel.show {
    display: flex;
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #e5eaf1;
    background: #f8fafc;
    flex-shrink: 0;
}

.notif-panel-header strong {
    font-size: 14px;
    color: #0f172a;
}

.notif-mark-read {
    font-size: 12px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 700;
}

.notif-mark-read:hover {
    text-decoration: underline;
}

.notif-panel-body {
    overflow-y: auto;
    padding: 8px;
}

.notif-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #2563eb;
    padding: 8px 8px 6px;
}

.notif-section-title.warn {
    color: #d97706;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 8px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: 0.15s;
}

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

.notif-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 13px;
    flex-shrink: 0;
}

.notif-item-icon.new {
    background: #2563eb;
}

.notif-item-icon.warn {
    background: #d97706;
}

.notif-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

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

.notif-item-text small {
    font-size: 11.5px;
    color: #64748b;
}

.notif-empty {
    text-align: center;
    padding: 30px 16px;
    color: #64748b;
}

.notif-empty i {
    font-size: 26px;
    color: #16a34a;
    margin-bottom: 8px;
    display: block;
}

.notif-empty p {
    margin: 0;
    font-size: 13px;
}

/* ---------- Dropdown menu Admin ---------- */

.user-wrap {
    position: relative;
}

.user-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 190px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.22);
    border: 1px solid #e5eaf1;
    z-index: 2000;
    overflow: hidden;
    padding: 6px;
}

.user-menu.show {
    display: flex;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #0f172a;
    font-size: 13px;
    font-weight: 600;
    transition: 0.15s;
}

.user-menu-item i {
    width: 16px;
    text-align: center;
    color: #64748b;
}

.user-menu-item:hover {
    background: #f1f5f9;
}

.user-menu-item.danger {
    color: #dc2626;
}

.user-menu-item.danger i {
    color: #dc2626;
}

.user-menu-divider {
    height: 1px;
    background: #e5eaf1;
    margin: 6px 4px;
}

@media (max-width: 700px) {
    .notif-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 14px 14px 0 0;
    }
}

/* ---------- Responsive (mobile / tablet, sama seperti breakpoint sidebar) ---------- */

@media (max-width: 900px) {
    .topbar {
        position: sticky;
        top: 0;
        z-index: 900;
        flex-direction: row;
        align-items: center;
        padding: 12px;
        gap: 10px;
        flex-wrap: nowrap;
    }

    .topbar-left {
        width: auto;
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .topbar-menu {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        flex-shrink: 0;
        font-size: 14px;
    }

    .topbar-logo img {
        height: 24px;
    }

    .topbar-search {
        flex: 1;
        min-width: 0;
        width: auto;
        height: 36px;
        padding: 0 10px;
        gap: 6px;
    }

    .topbar-search input {
        font-size: 12px;
    }

    .topbar-right {
        display: flex !important;
        width: auto;
        flex-shrink: 0;
        justify-content: flex-end;
        gap: 5px;
        margin-top: 0;
    }

    .topbar-icon {
        display: none;
    }

    .topbar-icon#darkModeToggle,
    .topbar-icon#notifBell {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        flex-shrink: 0;
        font-size: 14px;
    }

    .topbar-date,
    .topbar-user {
        font-size: 9.5px;
        padding: 5px 7px;
        gap: 4px;
        white-space: nowrap;
    }

    .topbar-date i,
    .topbar-user i {
        font-size: 9.5px;
    }
}