/* ============================================================
   RIPPLE — sidebar.css
   Collapsible sidebar — orange palette + Playfair
   ============================================================ */

:root {
    --sidebar-width: 240px;
    --sidebar-collapsed: 64px;
    --sidebar-bg: rgba(6, 9, 16, 0.97);
    --sidebar-border: rgba(243, 112, 30, 0.12);
    --sidebar-transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── SEMBUNYIKAN NAVBAR LAMA ─────────────────────────────── */
.navbar {
    display: none !important;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    backdrop-filter: blur(16px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width var(--sidebar-transition);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

/* Glow line kanan sidebar */
.sidebar::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg,
            transparent,
            rgba(243, 112, 30, 0.5),
            rgba(184, 58, 45, 0.3),
            rgba(243, 112, 30, 0.5),
            transparent);
    box-shadow: 0 0 8px rgba(243, 112, 30, 0.3);
}

/* ── SIDEBAR HEADER ──────────────────────────────────────── */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 16px;
    border-bottom: 1px solid rgba(243, 112, 30, 0.08);
    min-height: 72px;
    flex-shrink: 0;
}

.sidebar-logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #f3701e;
    text-shadow: 0 0 20px rgba(243, 112, 30, 0.6), 0 0 40px rgba(243, 112, 30, 0.2);
    white-space: nowrap;
    opacity: 1;
    transition: opacity var(--sidebar-transition);

    font-family: 'Inter', sans-serif;
}

.sidebar.collapsed .sidebar-logo {
    opacity: 0;
    pointer-events: none;
}

/* Tombol toggle */
.sidebar-toggle {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(243, 112, 30, 0.08);
    border: 1px solid rgba(243, 112, 30, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    color: #f3701e;
}

.sidebar-toggle:hover {
    background: rgba(243, 112, 30, 0.15);
    border-color: rgba(243, 112, 30, 0.6);
    box-shadow: 0 0 12px rgba(243, 112, 30, 0.3), 0 0 24px rgba(243, 112, 30, 0.1);
}

.toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toggle-icon span {
    display: block;
    width: 16px;
    height: 2px;
    background: #f3701e;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
    box-shadow: 0 0 6px rgba(243, 112, 30, 0.5);
}

.sidebar.collapsed .toggle-icon span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.sidebar.collapsed .toggle-icon span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.sidebar.collapsed .toggle-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* ── SIDEBAR NAV ─────────────────────────────────────────── */
.sidebar-nav {
    flex: 1;
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(243, 112, 30, 0.3);
    border-radius: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: rgba(232, 216, 201, 0.55);
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

.nav-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: #f3701e;
    border-radius: 0 3px 3px 0;
    transition: height 0.3s ease;
    box-shadow: 0 0 8px rgba(243, 112, 30, 0.6);
}

.nav-item:hover {
    background: rgba(243, 112, 30, 0.06);
    color: #e8d8c9;
}

.nav-item:hover::before {
    height: 60%;
}

.nav-item.active {
    background: rgba(243, 112, 30, 0.1);
    color: #f3701e;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(243, 112, 30, 0.4);
}

.nav-item.active::before {
    height: 70%;
}

.nav-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    transition: transform 0.3s ease;
}

.nav-item:hover .nav-icon {
    transform: scale(1.15);
}

.nav-text {
    opacity: 1;
    transition: opacity var(--sidebar-transition);
    overflow: hidden;
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    pointer-events: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
}

/* Tooltip saat collapsed */
.sidebar.collapsed .nav-item:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(var(--sidebar-collapsed) + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(6, 9, 16, 0.97);
    border: 1px solid rgba(243, 112, 30, 0.25);
    color: #f3701e;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 0 15px rgba(243, 112, 30, 0.15);
    font-family: 'Inter', sans-serif;
}

/* ── SIDEBAR FOOTER ──────────────────────────────────────── */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(243, 112, 30, 0.08);
    flex-shrink: 0;
}

.sidebar-footer-text {
    font-size: 10px;
    letter-spacing: 2px;
    color: rgba(243, 112, 30, 0.4);
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 1;
    transition: opacity var(--sidebar-transition);
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.sidebar.collapsed .sidebar-footer-text {
    opacity: 0;
}

.sidebar-footer-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f3701e;
    margin: 0 auto;
    box-shadow: 0 0 8px #f3701e, 0 0 16px rgba(243, 112, 30, 0.4);
    animation: footerPulse 2s ease-in-out infinite;
    display: none;
}

.sidebar.collapsed .sidebar-footer-dot {
    display: block;
}

@keyframes footerPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 8px #f3701e;
    }

    50% {
        opacity: 0.4;
        transform: scale(0.8);
        box-shadow: 0 0 4px #f3701e;
    }
}

/* ── MAIN CONTENT SHIFT ──────────────────────────────────── */
body {
    margin-left: var(--sidebar-width);
    transition: margin-left var(--sidebar-transition);
}

body.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed);
}

/* ── OVERLAY MOBILE ──────────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    backdrop-filter: blur(2px);
}

/* ── RESPONSIVE MOBILE ───────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 220px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--sidebar-transition), width var(--sidebar-transition);
        width: var(--sidebar-width) !important;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    body {
        margin-left: 0 !important;
    }

    .mobile-menu-btn {
        display: flex !important;
        position: fixed;
        top: 16px;
        left: 16px;
        width: 40px;
        height: 40px;
        background: rgba(6, 9, 16, 0.95);
        border: 1px solid rgba(243, 112, 30, 0.3);
        border-radius: 8px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 998;
        color: #f3701e;
        font-size: 18px;
        box-shadow: 0 0 12px rgba(243, 112, 30, 0.2);
    }
}

.mobile-menu-btn {
    display: none;
}
/* ── TOGGLE BUTTON — selalu keliatan ───────────────────── */
.sidebar-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    background: rgba(243,112,30,0.12) !important;
    border: 1px solid rgba(243,112,30,0.35) !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    flex-shrink: 0 !important;
}
.sidebar-toggle:hover {
    background: rgba(243,112,30,0.25) !important;
    border-color: #f3701e !important;
    box-shadow: 0 0 12px rgba(243,112,30,0.4) !important;
}
.toggle-icon span {
    display: block !important;
    width: 16px !important; height: 2px !important;
    background: #f3701e !important;
    margin: 3px 0 !important;
    border-radius: 2px !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 0 4px rgba(243,112,30,0.5) !important;
}

/* Saat collapsed — tombol jadi "→" biar jelas bisa dibuka */
.sidebar.collapsed .sidebar-toggle {
    background: rgba(243,112,30,0.18) !important;
    border-color: rgba(243,112,30,0.6) !important;
}
.sidebar.collapsed .toggle-icon span:nth-child(1) {
    transform: translateY(5px) rotate(45deg) !important;
}
.sidebar.collapsed .toggle-icon span:nth-child(2) {
    opacity: 0 !important;
}
.sidebar.collapsed .toggle-icon span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg) !important;
}

/* Tombol collapse di luar sidebar — muncul saat sidebar collapsed */
.sidebar-open-btn {
    position: fixed !important;
    left: 68px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 1001 !important;
    width: 22px !important;
    height: 48px !important;
    background: rgba(243,112,30,0.15) !important;
    border: 1px solid rgba(243,112,30,0.45) !important;
    border-left: none !important;
    border-radius: 0 8px 8px 0 !important;
    cursor: pointer !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    color: #f3701e !important;
    font-size: 12px !important;
    transition: all 0.25s ease !important;
    box-shadow: 3px 0 12px rgba(243,112,30,0.2) !important;
}
.sidebar-open-btn:hover {
    background: rgba(243,112,30,0.3) !important;
    box-shadow: 3px 0 20px rgba(243,112,30,0.45) !important;
    width: 28px !important;
}
body.sidebar-collapsed .sidebar-open-btn {
    display: flex !important;
}

/* ── RICH SIDEBAR DASHBOARD OVERRIDES ────────────────────── */
.sidebar {
    width: 320px !important;
    background: #020305 !important; /* extremely dark modern background */
    border-right: 1px solid rgba(243,112,30,0.1) !important;
}
.sidebar.collapsed { width: 72px !important; }
:root { --sidebar-width: 320px !important; --sidebar-collapsed: 72px !important; }

.sidebar-logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 16px; letter-spacing: 5px; color: #fff;
    text-shadow: 0 0 10px rgba(243,112,30,0.5); font-weight: 800; font-family: 'Orbitron', monospace;
}
.r-logo-icon { animation: spinSlow 15s linear infinite; }
@keyframes spinSlow { to{transform:rotate(360deg);} }

.sidebar-section-title {
    font-size: 8px; letter-spacing: 3px;
    color: rgba(255,255,255,0.4); text-transform: uppercase;
    margin: 16px 16px 8px; font-weight: 700;
}
.mt-4 { margin-top: 32px; }
.nav-badge {
    background: rgba(243,112,30,0.1); color: #f3701e;
    border: 1px solid rgba(243,112,30,0.25);
    font-size: 7px; padding: 2px 6px; border-radius: 4px;
    margin-left: auto; letter-spacing: 1px;
}
.nav-item {
    padding: 10px 16px !important;
    border-radius: 6px !important;
    margin: 0 8px !important;
}
.nav-item::before { display: none !important; } /* hide old line */

/* Widgets */
.sidebar-widget { padding: 0 20px; }
.widget-title {
    font-size: 8px; letter-spacing: 3px; color: rgba(255,255,255,0.4);
    margin-bottom: 12px; font-weight: 700; text-transform: uppercase;
}
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.val { font-family: 'Orbitron', monospace; color: #f3701e; font-size: 16px; text-shadow: 0 0 15px rgba(243,112,30,0.6); }

/* Profile */
.sidebar-footer-profile {
    display: flex; align-items: center; gap: 14px; padding: 20px;
    border-top: 1px solid rgba(243,112,30,0.1); background: rgba(0,0,0,0.4);
    cursor: pointer; transition: 0.4s; overflow: hidden;
    margin-top: auto;
}
.sidebar-footer-profile:hover { background: rgba(243,112,30,0.05); border-top-color: rgba(243,112,30,0.3); }
.profile-icon {
    width: 40px; height: 40px; background: rgba(243,112,30,0.15); border: 1px solid rgba(243,112,30,0.4);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #f3701e; font-weight: 700; box-shadow: 0 0 15px rgba(243,112,30,0.2); font-size: 14px;
    transition: 0.4s; flex-shrink: 0;
}
.sidebar-footer-profile:hover .profile-icon { transform: scale(1.1) rotate(15deg); }
.profile-info { flex: 1; overflow: hidden; }
.p-name { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 1px; }
.p-sub { font-size: 8px; color: rgba(243,112,30,0.8); letter-spacing: 2px; }
.p-arrow { color: rgba(255,255,255,0.3); font-size: 18px; transition: 0.3s; }
.sidebar-footer-profile:hover .p-arrow { transform: translateX(4px); color: #f3701e;}

/* Sleek Dashboard Widgets */
.w-label { font-size: 8px; color: rgba(255,255,255,0.4); letter-spacing: 2px; font-family: 'Inter', sans-serif; font-weight: 700; display: block; }
.w-val { font-family: 'Orbitron', monospace; font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.neon-green { color: #30f3a0; text-shadow: 0 0 8px rgba(48,243,160,0.6); }
.neon-blue { color: #4b8ff3; text-shadow: 0 0 8px rgba(75,143,243,0.6); }
.w-progress-wrap { width: 100%; height: 3px; background: rgba(255,255,255,0.05); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.w-progress-fill { height: 100%; border-radius: 3px; }
.bg-green { background: #30f3a0; box-shadow: 0 0 10px #30f3a0; animation: progPulseG 3s infinite alternate; }
.bg-blue { background: #4b8ff3; box-shadow: 0 0 10px #4b8ff3; animation: progPulseB 3s infinite alternate; }
.sidebar-widget { padding: 0 16px; margin-bottom: 20px; opacity: 1; transition: opacity var(--sidebar-transition); }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }

@keyframes progPulseG { 0% { box-shadow: 0 0 5px #30f3a0; } 100% { box-shadow: 0 0 15px #30f3a0; } }
@keyframes progPulseB { 0% { box-shadow: 0 0 5px #4b8ff3; } 100% { box-shadow: 0 0 15px #4b8ff3; } }

/* Hide elements on collapsed */
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .sidebar-widget,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .profile-info,
.sidebar.collapsed .p-arrow { display: none !important; }
.sidebar.collapsed .nav-item { padding: 12px !important; margin: 4px 8px !important; justify-content: center !important;}
/* 
  ============================================================
  ADDED FOR INDEX.HTML COMPATIBILITY (#nav style)
  ============================================================ 
*/
#nav {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 2000;
  width: 280px; padding: 24px 20px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 24px;
  background: rgba(14,11,9,0.98);
  backdrop-filter: blur(28px);
  border-right: 1px solid rgba(249,115,22,0.12);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-100%);
  overflow-y: auto; overflow-x: hidden;
  font-family: 'Inter', sans-serif;
}
#nav::-webkit-scrollbar { width: 0px; }
body.nav-open #nav {
  transform: translateX(0);
}
#nav-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); z-index: 1999;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease;
  backdrop-filter: blur(4px);
}
body.nav-open #nav-overlay {
  opacity: 1; pointer-events: auto;
}
.nav-toggle-btn {
  position: fixed; top: 24px; left: 24px; z-index: 1998;
  background: rgba(12,10,8,0.8); border: 1px solid rgba(249,115,22,0.3);
  color: #fff; padding: 12px; border-radius: 12px;
  cursor: pointer; backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.nav-toggle-btn:hover { background: rgba(249,115,22,0.2); box-shadow: 0 4px 24px rgba(249,115,22,0.3); }

.nav-profile-section {
  display: flex; flex-direction: column; align-items: center; width: 100%;
  margin-bottom: 8px; margin-top: 10px;
}
.nav-profile-aura {
  width: 90px; height: 90px; border-radius: 50%;
  background: linear-gradient(135deg, #f97316, #8b5cf6, #3b82f6);
  padding: 3px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; animation: pulseAura 4s infinite alternate;
}
@keyframes pulseAura {
  0% { box-shadow: 0 0 15px rgba(249,115,22,0.4); transform: scale(1); }
  100% { box-shadow: 0 0 30px rgba(139,92,246,0.6); transform: scale(1.05); }
}
.nav-profile-avatar {
  width: 100%; height: 100%; border-radius: 50%;
  background-color: #f97316; background-size: cover; background-position: center;
  border: 3px solid #0e0b09;
}
.nav-profile-name { font-size: 1.15rem; color: #fff; margin-bottom: 4px; font-weight: 700; text-align: center; }
.nav-profile-role { font-size: 0.75rem; color: #a1a1aa; font-weight: 600; text-align: center; letter-spacing: 0.05em; text-transform: uppercase; }

.nav-links { display: flex; flex-direction: column; width: 100%; gap: 6px; flex: 1; }
.nav-link-btn {
  display: flex; align-items: center; justify-content: flex-start; gap: 14px;
  padding: 14px 20px; border-radius: 16px; font-size: 0.9rem; font-weight: 600;
  color: #a1a1aa; transition: all 0.3s ease;
  width: 100%; background: transparent; border: none; cursor: pointer; position: relative;
  text-decoration: none;
}
.nav-link-btn:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-link-btn.active {
  background: #f97316; color: #fff; box-shadow: 0 4px 15px rgba(249,115,22,0.3);
}
.nav-icon { font-size: 1.2rem; }
.nav-badge {
  background: rgba(0,0,0,0.3); color: #fff; font-size: 0.65rem; padding: 3px 8px;
  border-radius: 20px; margin-left: auto; font-weight: 700;
}
.nav-link-btn.active .nav-badge { background: rgba(255,255,255,0.25); }

.nav-bottom-cta { width: 100%; margin-top: auto; padding-top: 10px; }
.nav-cta-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.05) 100%);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 24px; padding: 24px 20px; text-align: center;
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center;
}
.nav-globe-mini-wrap {
  width: 56px; height: 56px; border-radius: 50%; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
  border: 1px solid rgba(249,115,22,0.3); box-shadow: 0 0 20px rgba(249,115,22,0.2);
  overflow: hidden;
}
.nav-globe-mini {
  border-radius: 50%;
}
.nav-cta-card p { font-size: 0.85rem; color: #fff; font-weight: 700; margin-bottom: 16px; line-height: 1.4; }
