/* =========================================================================
   STYLE UTAMA APLIKASI KSP RHN (style/index.css) - LIGHT & DESKTOP ONLY
   ========================================================================= */
:root {
    --bg-body: #f1f5f9;
    --bg-sidebar: #ffffff;
    --bg-sidebar-hover: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --sidebar-width: 268px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: var(--text-main);
    background-color: var(--bg-body);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ================= BLOKIR LAYAR KECIL (< 1024px) ================= */
.desktop-blocker {
    display: none;
    position: fixed;
    inset: 0;
    background: #0f172a;
    color: #ffffff;
    z-index: 99999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
}

.desktop-blocker i {
    font-size: 48px;
    color: #ef4444;
    margin-bottom: 16px;
}

.desktop-blocker h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.desktop-blocker p {
    font-size: 14px;
    color: #94a3b8;
    max-width: 420px;
    line-height: 1.6;
}

@media screen and (max-width: 1023px) {
    .desktop-blocker {
        display: flex !important;
    }
    .sidebar, .main-wrapper {
        display: none !important;
    }
}

/* ================= SIDEBAR (LIGHT THEME) ================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

.brand {
    height: 68px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.brand-text h1 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.brand-text span {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

/* ================= ACCORDION MENU SIDEBAR (MULTI-LEVEL) ================= */
.nav-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px 24px;
}

.nav-scroll::-webkit-scrollbar {
    width: 4px;
}

.nav-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.nav-group {
    margin-bottom: 4px;
    border-radius: 10px;
}

/* Tombol Level 1 (Kategori Utama) */
.nav-group-toggle {
    width: 100%;
    background: transparent;
    border: none;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-group-title i {
    font-size: 15px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #f1f5f9;
}

.nav-group-toggle:hover {
    background: var(--bg-sidebar-hover);
}

.nav-group-toggle .chevron {
    font-size: 11px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.nav-group.open > .nav-group-toggle {
    background: #f8fafc;
    color: var(--primary);
    font-weight: 700;
}

.nav-group.open > .nav-group-toggle .chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

.nav-group-items {
    display: none;
    padding: 4px 0 6px 18px;
    margin-left: 14px;
    border-left: 1.5px solid #e2e8f0;
}

.nav-group.open > .nav-group-items {
    display: block;
}

/* Tombol Level 2 (Sub-Kategori) */
.nav-subgroup {
    margin-bottom: 2px;
}

.nav-subgroup-toggle {
    width: 100%;
    background: transparent;
    border: none;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    border-radius: 6px;
    text-align: left;
    transition: all 0.15s ease;
}

.nav-subgroup-toggle:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-main);
}

.nav-subgroup-toggle .sub-chevron {
    font-size: 10px;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.nav-subgroup.open > .nav-subgroup-toggle {
    color: var(--primary);
}

.nav-subgroup.open > .nav-subgroup-toggle .sub-chevron {
    transform: rotate(90deg);
    color: var(--primary);
}

.nav-subgroup-items {
    display: none;
    padding: 2px 0 4px 10px;
    margin-left: 8px;
    border-left: 1px dashed #cbd5e1;
}

.nav-subgroup.open > .nav-subgroup-items {
    display: block;
}

/* Link Modul (Level 3 & Direct Item) */
.nav-subitem {
    display: block;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 1px;
    transition: all 0.15s ease;
}

.nav-subitem.direct-item {
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
}

.nav-subitem:hover {
    color: var(--text-main);
    background: var(--bg-sidebar-hover);
}

.nav-subitem.active {
    background: #eef2ff;
    color: var(--primary);
    font-weight: 600;
}

/* Item Mandiri (Dashboard) */
.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    color: #334155;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 2px;
    transition: all 0.15s ease;
}

.nav-item i {
    font-size: 15px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #f1f5f9;
}

.nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-main);
}

.nav-item.active {
    background: #eef2ff;
    color: var(--primary);
}

.nav-item.active i {
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.12);
}

/* ================= MAIN WRAPPER & TOPBAR ================= */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-collapsed .main-wrapper {
    margin-left: 0;
}

.topbar {
    height: 68px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-toggle-sidebar {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-main);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-toggle-sidebar:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.page-header h2 {
    font-size: 16.5px;
    font-weight: 700;
}

.page-header p {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.badge-security {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #4338ca;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

/* ================= CONTENT & KOMPONEN ================= */
.content {
    padding: 26px;
    flex: 1;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stat-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    margin: 8px 0 6px;
    font-variant-numeric: tabular-nums;
}

.stat-trend {
    font-size: 11.5px;
    font-weight: 600;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.panel {
    background: var(--card-bg);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    padding: 22px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    margin-bottom: 24px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.panel-head h3 {
    font-size: 15px;
    font-weight: 700;
}

.btn-action {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-action:hover {
    background: var(--primary-hover);
}

table.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

table.modern-table th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

table.modern-table td {
    padding: 12px;
    font-size: 13.5px;
    border-bottom: 1px solid #f1f5f9;
}

.status-pill {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
}



/* ================= FOOTER STATUS BAR RINGKAS ================= */
.app-footer {
    height: 32px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 0 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.footer-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-status i {
    font-size: 12px;
    color: var(--primary);
}

.footer-status .sep {
    margin: 0 4px;
    color: #cbd5e1;
}

.footer-status strong {
    color: var(--text-main);
    font-weight: 600;
}

.footer-copy {
    font-size: 11px;
    color: #94a3b8;
}

/* ================= DROPDOWN PROFIL TOPBAR ================= */
.user-dropdown {
    position: relative;
    padding-left: 16px;
    border-left: 1px solid var(--border-color);
}

.user-profile-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 5px 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all 0.15s ease;
}

.user-profile-btn:hover,
.user-dropdown.open .user-profile-btn {
    background: #f8fafc;
    border-color: var(--border-color);
}

.user-info .user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
}

.user-info .user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.chevron-profile {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 2px;
    transition: transform 0.2s ease;
}

.user-dropdown.open .chevron-profile {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 210px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    padding: 6px;
    display: none;
    z-index: 200;
}

.user-dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-header {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
}

.dropdown-header strong {
    display: block;
    font-size: 12.5px;
    color: var(--text-main);
}

.dropdown-header span {
    font-size: 11px;
    color: #10b981;
    font-weight: 600;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.dropdown-item i {
    font-size: 15px;
    color: var(--text-muted);
}

.dropdown-item:hover {
    background: #f1f5f9;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.dropdown-item.text-danger {
    color: #dc2626;
    font-weight: 600;
}

.dropdown-item.text-danger i {
    color: #dc2626;
}

.dropdown-item.text-danger:hover {
    background: #fef2f2;
}


/* ================= INTERNAL CHAT DRAWER (SLIDE-OVER) ================= */
.btn-chat-trigger {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
}

.btn-chat-trigger i {
    color: var(--primary);
    font-size: 14px;
}

.btn-chat-trigger:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}

.chat-badge {
    background: #ef4444;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
}

.chat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.25);
    backdrop-filter: blur(1px);
    z-index: 998;
    display: none;
}

.chat-overlay.show {
    display: block;
}

.chat-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    background: #ffffff;
    border-left: 1px solid var(--border-color);
    box-shadow: -8px 0 30px rgba(15, 23, 42, 0.1);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-drawer.open {
    transform: translateX(0);
}

.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 7px;
}

.chat-header span {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-close-chat {
    background: #f1f5f9;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
}

.btn-close-chat:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.chat-channels {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.channel-tab {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    border-radius: 7px;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.channel-tab.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.dot-unread {
    width: 6px;
    height: 6px;
    background: #ef4444;
    border-radius: 50%;
}

.chat-Subheader {
    padding: 8px 18px;
    font-size: 12px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chat-msg {
    max-width: 86%;
    display: flex;
    flex-direction: column;
}

.chat-msg.incoming {
    align-self: flex-start;
}

.chat-msg.outgoing {
    align-self: flex-end;
}

.msg-meta {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.chat-msg.outgoing .msg-meta {
    text-align: right;
}

.msg-bubble {
    padding: 10px 13px;
    border-radius: 12px;
    font-size: 12.5px;
    line-height: 1.5;
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.chat-msg.outgoing .msg-bubble {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #1e1b4b;
}

.msg-tag {
    margin-top: 7px;
    padding: 5px 8px;
    background: #f1f5f9;
    border-left: 3px solid var(--primary);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
}

.chat-footer {
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
}

.chat-ref-bar input {
    width: 100%;
    padding: 6px 10px;
    font-family: inherit;
    font-size: 11.5px;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #f8fafc;
}

.chat-input-row {
    display: flex;
    gap: 8px;
}

.chat-input-row input {
    flex: 1;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 12.5px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
}

.chat-input-row input:focus {
    border-color: var(--primary);
}

.btn-send-chat {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
}

.btn-send-chat:hover {
    background: var(--primary-hover);
}

/* ================= CHAT LAYOUT ALA FACEBOOK (DUA KOLOM) ================= */
.chat-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 720px; /* Lebar diperbesar untuk 2 kolom */
    background: #ffffff;
    border-left: 1px solid var(--border-color);
    box-shadow: -10px 0 35px rgba(15, 23, 42, 0.12);
    z-index: 999;
    display: flex;
    flex-direction: row; /* Berjajar kiri-kanan */
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-drawer.open {
    transform: translateX(0);
}

/* Kolom Kiri: Sidebar Daftar Chat */
.chat-sidebar-list {
    width: 275px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: #f8fafc;
}

.chat-list-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
}

.chat-list-header h3 {
    font-size: 14.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 7px;
}

.chat-list-header .sub-title {
    font-size: 11px;
    color: var(--text-muted);
}

.chat-filter-tabs {
    display: flex;
    padding: 8px 12px;
    gap: 6px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
}

.filter-tab {
    flex: 1;
    background: #f1f5f9;
    border: none;
    padding: 6px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}

.filter-tab.active {
    background: var(--primary);
    color: #ffffff;
}

.chat-items-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: background 0.15s ease;
}

.chat-item:hover {
    background: #f1f5f9;
}

.chat-item.active {
    background: #eef2ff;
}

.chat-item.offline {
    opacity: 0.65;
}

.item-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #4338ca;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    position: relative;
    flex-shrink: 0;
}

.item-avatar.channel-av {
    background: #e0e7ff;
    color: var(--primary);
    border-radius: 10px;
}

.item-avatar.gray {
    background: #e2e8f0;
    color: #64748b;
}

.status-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #ffffff;
}

.status-dot.online {
    background: #10b981;
}

.status-dot.offline {
    background: #94a3b8;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.item-top strong {
    font-size: 12.5px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-top .time {
    font-size: 10px;
    color: var(--text-muted);
}

.item-preview {
    font-size: 11.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-badge {
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
}

/* Kolom Kanan: Ruang Obrolan Aktif */
.chat-main-room {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.room-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
}

.room-title-wrapper strong {
    display: block;
    font-size: 14.5px;
    font-weight: 700;
}

.room-title-wrapper span {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-close-drawer {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
}

.btn-close-drawer:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

/* ================= TEMA WARNA TAMBAHAN (DIM & DARK) ================= */
.theme-switcher-row {
    display: flex;
    gap: 8px;
    padding: 6px 10px;
    justify-content: center;
}

.theme-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.theme-btn:hover {
    transform: scale(1.1);
}

.theme-btn.light { background: #ffffff; }
.theme-btn.dim   { background: #1e293b; }
.theme-btn.dark  { background: #0f172a; }

/* VARIABEL KETIKA BODY BER-CLASS .theme-dim */
body.theme-dim {
    --bg-body: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-sidebar-hover: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --card-bg: #1e293b;
}

body.theme-dim .topbar,
body.theme-dim .panel,
body.theme-dim .stat-card,
body.theme-dim .app-footer,
body.theme-dim .dropdown-menu {
    background: #1e293b;
    color: #f8fafc;
}

body.theme-dim table.modern-table th {
    background: #0f172a;
    color: #94a3b8;
}

body.theme-dim table.modern-table td {
    border-bottom-color: #334155;
}

/* VARIABEL KETIKA BODY BER-CLASS .theme-dark (Pekat) */
body.theme-dark {
    --bg-body: #000000;
    --bg-sidebar: #121212;
    --bg-sidebar-hover: #222222;
    --text-main: #e5e5e5;
    --text-muted: #a3a3a3;
    --border-color: #262626;
    --card-bg: #121212;
}

body.theme-dark .topbar,
body.theme-dark .panel,
body.theme-dark .stat-card,
body.theme-dark .app-footer,
body.theme-dark .dropdown-menu {
    background: #121212;
    color: #e5e5e5;
}

body.theme-dark table.modern-table th {
    background: #000000;
    color: #a3a3a3;
}

body.theme-dark table.modern-table td {
    border-bottom-color: #262626;
}

/* ================= PERBAIKAN WARNA KONTRAS TEMA DIM & DARK ================= */

/* 1. Tombol Buka-Tutup Sidebar & Ikon Topbar */
body.theme-dim .btn-toggle-sidebar,
body.theme-dark .btn-toggle-sidebar,
body.theme-dim .btn-chat-trigger,
body.theme-dark .btn-chat-trigger {
    background: var(--card-bg);
    color: var(--text-main);
    border-color: var(--border-color);
}

body.theme-dim .btn-toggle-sidebar:hover,
body.theme-dark .btn-toggle-sidebar:hover,
body.theme-dim .btn-chat-trigger:hover,
body.theme-dark .btn-chat-trigger:hover {
    background: var(--bg-sidebar-hover);
}

/* 2. User Info Hover di Topbar */
body.theme-dim .user-profile-btn:hover,
body.theme-dim .user-dropdown.open .user-profile-btn,
body.theme-dark .user-profile-btn:hover,
body.theme-dark .user-dropdown.open .user-profile-btn {
    background: var(--bg-sidebar-hover);
    border-color: var(--border-color);
}

/* 3. Panel Chat (Memo) & Drawer */
body.theme-dim .chat-drawer,
body.theme-dark .chat-drawer {
    background: var(--card-bg);
    border-left-color: var(--border-color);
}

body.theme-dim .chat-sidebar-list,
body.theme-dark .chat-sidebar-list {
    background: var(--bg-sidebar);
    border-right-color: var(--border-color);
}

body.theme-dim .chat-list-header,
body.theme-dark .chat-list-header,
body.theme-dim .chat-filter-tabs,
body.theme-dark .chat-filter-tabs,
body.theme-dim .chat-channels,
body.theme-dark .chat-channels,
body.theme-dim .chat-Subheader,
body.theme-dark .chat-Subheader,
body.theme-dim .room-header,
body.theme-dark .room-header,
body.theme-dim .chat-footer,
body.theme-dark .chat-footer {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-main);
}

body.theme-dim .chat-body,
body.theme-dark .chat-body {
    background: var(--bg-body);
}

/* 4. Tab & Item Chat */
body.theme-dim .channel-tab,
body.theme-dim .filter-tab,
body.theme-dark .channel-tab,
body.theme-dark .filter-tab {
    background: var(--bg-sidebar-hover);
    color: var(--text-muted);
    border-color: var(--border-color);
}

body.theme-dim .channel-tab.active,
body.theme-dim .filter-tab.active,
body.theme-dark .channel-tab.active,
body.theme-dark .filter-tab.active {
    background: var(--primary);
    color: #ffffff;
}

body.theme-dim .chat-item:hover,
body.theme-dark .chat-item:hover {
    background: var(--bg-sidebar-hover);
}

body.theme-dim .chat-item.active,
body.theme-dark .chat-item.active {
    background: rgba(79, 70, 229, 0.15);
}

/* 5. Bubble Chat (Pesan Masuk & Keluar) */
body.theme-dim .msg-bubble,
body.theme-dark .msg-bubble {
    background: var(--card-bg);
    color: var(--text-main);
    border-color: var(--border-color);
}

body.theme-dim .chat-msg.outgoing .msg-bubble,
body.theme-dark .chat-msg.outgoing .msg-bubble {
    background: rgba(79, 70, 229, 0.2);
    color: var(--text-main);
    border-color: rgba(79, 70, 229, 0.4);
}

body.theme-dim .msg-tag,
body.theme-dark .msg-tag {
    background: var(--bg-body);
    color: #818cf8; /* Warna teks tautan tag yang lebih kontras dan terang */
    border-left-color: var(--primary);
}

/* 6. Input Form pada Chat */
body.theme-dim .chat-ref-bar input,
body.theme-dim .chat-input-row input,
body.theme-dark .chat-ref-bar input,
body.theme-dark .chat-input-row input {
    background: var(--bg-body);
    color: var(--text-main);
    border-color: var(--border-color);
}