/* ===============================
   SIDEBAR THEME - MODERN ENTERPRISE
================================= */

/* Variables for easy theming */
:root {
    --sidebar-bg: #14293b;
    --sidebar-bg-secondary: #183248;
    --sidebar-text: #cbd5e1;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: rgba(240, 90, 41, 0.12);
    --sidebar-active-text: #ffffff;
    --sidebar-border: rgba(255, 255, 255, 0.06);
    --sidebar-accent: #f05a29;
    --sidebar-width: 260px;
    --navbar-bg: #14293b;
    --navbar-accent: #f05a29;
    --navbar-text: #e2e8f0;
    --navbar-text-hover: #ffffff;
}

/* Sidebar Container */
.app-sidebar.sidebar-custom {
    background-color: var(--sidebar-bg) !important;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(0, 0, 0, 0) 60%) !important;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 4px 0 24px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    --lte-sidebar-color: var(--sidebar-text);
    --lte-sidebar-hover-color: var(--sidebar-text-hover);
    --lte-sidebar-hover-bg: var(--sidebar-bg-secondary);
    --lte-sidebar-menu-active-color: var(--sidebar-active-text);
    --lte-sidebar-menu-active-bg: var(--sidebar-active-bg);
    --lte-sidebar-submenu-color: var(--sidebar-text);
    --lte-sidebar-submenu-hover-color: var(--sidebar-text-hover);
    --lte-sidebar-submenu-hover-bg: var(--sidebar-bg-secondary);
    --lte-sidebar-submenu-active-color: var(--sidebar-active-text);
    --lte-sidebar-submenu-active-bg: rgba(240, 90, 41, 0.10);
}

.app-sidebar.sidebar-custom .sidebar-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Brand Section */
.app-sidebar .sidebar-brand {
    height: 70px;
    background-color: var(--sidebar-bg);
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
}

.brand-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-modern {
    width: 40px;
    height: 40px;
    background: var(--sidebar-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.brand-logo-horizontal {
    width: 24px !important;
    height: 24px !important;
    object-fit: contain;
}

.brand-text-horizontal {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--sidebar-text);
    font-weight: 500;
}

/* User Profile Section (New) */
.sidebar-user-profile {
    padding: 20px 20px 10px;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 10px;
}

.user-profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--sidebar-bg-secondary);
    color: var(--sidebar-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    border: 2px solid rgba(255,255,255,0.05);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    color: var(--sidebar-text);
    font-size: 12px;
    text-transform: capitalize;
}

.user-status {
    margin-top: 2px;
    color: rgba(226, 232, 240, 0.75);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: #00a65a;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}

.navbar-user-avatar {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.15);
    vertical-align: middle;
}

.navbar-user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.navbar-user-avatar-icon {
    font-size: 22px;
    line-height: 1;
    color: #ffffff;
}

/* Sidebar Menu */
.sidebar-menu {
    padding: 10px 12px;
}

.nav-header {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--sidebar-text);
    font-weight: 700;
    letter-spacing: 1px;
    padding: 16px 12px 8px;
    opacity: 0.7;
}

.nav-item {
    margin-bottom: 4px;
}

.app-sidebar.sidebar-custom .nav-link {
    color: var(--sidebar-text);
    padding: 10px 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}

.app-sidebar.sidebar-custom .nav-link p,
.app-sidebar.sidebar-custom .nav-link span,
.app-sidebar.sidebar-custom .nav-link small {
    color: inherit !important;
}

.app-sidebar.sidebar-custom .nav-link:hover {
    background-color: var(--sidebar-bg-secondary);
    color: var(--sidebar-text-hover) !important;
}

.app-sidebar.sidebar-custom .nav-link.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text) !important;
    box-shadow: none;
    font-weight: 600;
    border-left: 3px solid var(--sidebar-accent);
}

.sidebar-wrapper .sidebar-menu > .nav-item.menu-open .nav-link.active:not(:hover) {
    --lte-sidebar-menu-active-bg: var(--sidebar-active-bg);
}

.nav-icon {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
    transition: all 0.2s;
    color: inherit;
}

/* Baris menu + chevron: ellipsis AdminLTE pada .nav-link p memotong ikon di dalam <p> */
.app-sidebar.sidebar-custom .nav-link p.nav-link-with-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-width: 0;
    overflow: visible;
}

.app-sidebar.sidebar-custom .nav-link p .nav-link-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1 1 auto;
}

.submenu-toggle {
    flex-shrink: 0;
    margin-left: 0;
    font-size: 0.95rem;
    opacity: 0.92;
    transition: transform 0.2s;
    color: rgba(255, 255, 255, 0.85);
}

.app-sidebar.sidebar-custom .nav-treeview .submenu-toggle {
    color: rgba(255, 255, 255, 0.8);
}

.app-sidebar.sidebar-custom .menu-open > .nav-link .submenu-toggle {
    transform: rotate(90deg);
}

/* Submenu Styling */
.app-sidebar.sidebar-custom .nav-treeview {
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid var(--sidebar-border);
    margin-top: 4px;
}

.app-sidebar.sidebar-custom .nav-treeview .nav-link {
    font-size: 13px;
    padding: 8px 12px;
}

.app-sidebar.sidebar-custom .nav-treeview .nav-link.active {
    background-color: rgba(240, 90, 41, 0.10);
    color: var(--sidebar-active-text) !important;
    box-shadow: none;
    border: 1px solid rgba(240, 90, 41, 0.22);
}

.app-sidebar.sidebar-custom .nav-treeview .nav-link:hover {
    background-color: var(--sidebar-bg-secondary);
    color: var(--sidebar-text-hover) !important;
}

/* Scrollbar Styling */
.sidebar-wrapper::-webkit-scrollbar {
    width: 5px;
}
.sidebar-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-wrapper::-webkit-scrollbar-thumb {
    background: var(--sidebar-bg-secondary);
    border-radius: 10px;
}

/* Dark Mode Adjustments */
.dark-mode {
    --sidebar-bg: #0b1120;
    --sidebar-bg-secondary: #1e293b;
    --sidebar-border: #1e293b;
}

/* Enterprise Header/Navbar Enhancements */
.app-header.navbar {
    background: var(--navbar-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    height: 64px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.app-header.navbar .navbar-nav .nav-link {
    color: var(--navbar-text);
    font-weight: 500;
    font-size: 14px;
}

.app-header.navbar .navbar-nav .nav-link:hover {
    color: var(--navbar-text-hover);
}

.app-header.navbar .navbar-nav .nav-link i {
    color: inherit;
}

.app-header.navbar .navbar-user-avatar {
    background: rgba(255, 255, 255, 0.12);
}

.app-header.navbar .navbar-user-avatar-icon {
    color: #ffffff;
}

.navbar-toggle-btn {
    width: 48px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--navbar-accent);
    color: #ffffff !important;
}

.navbar-toggle-btn:hover {
    color: #ffffff !important;
    filter: brightness(1.02);
}

.app-header.navbar .user-menu > a.nav-link {
    height: 64px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    background: var(--navbar-accent);
    color: #ffffff;
}

.app-header.navbar .user-menu > a.nav-link:hover {
    color: #ffffff;
    filter: brightness(1.02);
}

.app-header.navbar .user-menu > a.nav-link.dropdown-toggle::after {
    color: #ffffff;
}

.navbar-trial-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    font-size: 13px;
    line-height: 1;
}

.navbar-trial-info .trial-label {
    font-weight: 600;
    opacity: 0.95;
}

.navbar-trial-info .trial-days {
    font-weight: 500;
    opacity: 0.95;
}

.navbar-trial-info .trial-sep {
    opacity: 0.5;
}

.navbar-trial-info .trial-upgrade {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
}

.navbar-trial-info .trial-upgrade:hover {
    color: #ffffff;
    text-decoration: underline;
}

.navbar-brand-pluto {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    text-decoration: none;
}

.navbar-brand-pluto:hover {
    color: #ffffff;
}

.navbar-brand-pluto img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.navbar-brand-pluto .brand-text {
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

/* Card Styling for Dashboard */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem 1.5rem;
    border-radius: 12px 12px 0 0 !important;
}

.card-header h6 {
    font-weight: 700;
    color: #1e293b;
    font-size: 16px;
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

/* Enterprise Tab Bar */
.enterprise-tabbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 0;
}

.enterprise-tabs .nav-link {
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid transparent;
    margin-right: 8px;
}

.enterprise-tabs .nav-link.active {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
    box-shadow: none;
}

.enterprise-tabs .nav-link:hover {
    background: #e2e8f0;
}

/* Enterprise Footer */
.enterprise-footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -1px 3px rgba(0,0,0,.4);
}

.enterprise-footer .footer-logo {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
}

.dark-mode .enterprise-footer .footer-company { color: #b8e6e3; }

.modal-backdrop {
    background-color: transparent !important;
}

.modal-backdrop.show {
    opacity: 0 !important;
}
