﻿/* ========================================================= */
/* 🌐 GLOBAL BASE */
/* ========================================================= */

html, body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: linear-gradient(135deg, #5b8df9, #2ed6a8);
    color: #333;
    overflow-x: hidden;
}

/* ========================================================= */
/* 🔐 LOGIN */
/* ========================================================= */

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    width: 380px;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 2rem;
    text-align: center;
}

    .login-card h4 {
        font-weight: 600;
        margin-bottom: 1rem;
    }

/* ========================================================= */
/* 🧩 FORM & BUTTON */
/* ========================================================= */

.form-control {
    border-radius: 8px;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
}

/* ========================================================= */
/* 🧱 ADMINLTE CORE LAYOUT */
/* ========================================================= */

.wrapper {
    min-height: 100vh;
    position: relative;
}

.content-wrapper {
    min-height: calc(100vh - 57px);
    padding-bottom: 70px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.main-footer {
    position: relative;
    font-size: 0.9rem;
    color: #888;
}

/* ========================================================= */
/* 📚 SIDEBAR (ADMINLTE) */
/* ========================================================= */
/*
.main-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    height: 100vh;
    overflow-y: auto;
    z-index: 1040;
}*/

.main-sidebar {
    width: 250px;
    overflow-y: auto;
    z-index: 1040;
}

/* Sidebar menu */
.nav-sidebar .nav-item {
    margin-bottom: 0.2rem;
}

.nav-sidebar .nav-link {
    color: #c2c7d0;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

    .nav-sidebar .nav-link:hover {
        background-color: rgba(255,255,255,0.12);
        color: #fff;
    }

    .nav-sidebar .nav-link.active {
        background-color: #007bff;
        color: #fff;
    }

/* Treeview */
.nav-sidebar .nav-treeview {
    padding-left: 0;
    list-style: none;
    background-color: rgba(0,0,0,0.15);
}

    .nav-sidebar .nav-treeview .nav-link {
        padding: 0.4rem 1rem 0.4rem 2rem;
        font-size: 0.85rem;
    }

/* ========================================================= */
/* 🔔 NOTIFICATION */
/* ========================================================= */

.notif-item {
    display: flex;
    align-items: flex-start;
}

.notif-text {
    max-width: 260px;
    word-wrap: break-word;
    font-size: 14px;
}

.notif-time {
    font-size: 11px;
    color: #888;
}

.notif-dropdown {
    max-height: 320px;
    overflow-y: auto;
}

/* ========================================================= */
/* ⏳ LOADING OVERLAY */
/* ========================================================= */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-box {
    background: white;
    padding: 30px 40px;
    border-radius: 10px;
    text-align: center;
    min-width: 260px;
}

/* ========================================================= */
/* 📱 MOBILE & MAUI WEBVIEW FIX */
/* ========================================================= */

@media (max-width: 991.98px) {

    .main-sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
    }

    body.sidebar-open .main-sidebar {
        transform: translateX(0);
    }

    .content-wrapper,
    .main-header,
    .main-footer {
        margin-left: 0 !important;
    }
}

/* ========================================================= */
/* 🚫 HIDE BLAZOR ERROR UI (MAUI SAFE) */
/* ========================================================= */

#blazor-error-ui {
    display: none !important;
}

/*======================================================
AI WIDGET
======================================================*/

.ai-widget {
    position: fixed !important;
    right: 28px !important;
    bottom: 80px !important;
    z-index: 999999 !important;
}

.ai-float-btn {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    border: none !important;
    outline: none !important;
    background: #fff !important;
    padding: 4px !important;
    cursor: pointer !important;
    box-shadow: 0 10px 25px rgba(0,0,0,.22) !important;
    overflow: hidden !important;
}

    .ai-float-btn img {
        width: 42px !important;
        height: 42px !important;
        max-width: 42px !important;
        max-height: 42px !important;
        object-fit: contain !important;
        display: block !important;
    }

.ai-chat-window {
    position: absolute !important;
    right: 0 !important;
    bottom: 70px !important;
    width: 380px !important;
    height: 520px !important;
    background: #fff !important;
    border-radius: 18px !important;
    box-shadow: 0 16px 45px rgba(0,0,0,.28) !important;
    z-index: 999999 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.ai-chat-header {
    height: 68px !important;
    padding: 0 18px !important;
    border-bottom: 1px solid #e5e7eb !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: #fff !important;
}

.ai-title {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    font-weight: 700 !important;
    font-size: 18px !important;
}

    .ai-title img,
    .ai-avatar {
        width: 32px !important;
        height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
        object-fit: contain !important;
        border-radius: 50% !important;
    }

    .ai-title small {
        display: block !important;
        font-size: 11px !important;
        color: #6b7280 !important;
        font-weight: 400 !important;
        margin-top: 2px !important;
    }

.ai-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.ai-close {
    border: none !important;
    background: transparent !important;
    font-size: 26px !important;
    line-height: 1 !important;
    cursor: pointer !important;
}

.ai-clear {
    border: none !important;
    background: #f3f4f6 !important;
    border-radius: 8px !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    cursor: pointer !important;
}

.ai-chat-body {
    flex: 1 !important;
    padding: 18px !important;
    background: #f8fafc !important;
    overflow-y: auto !important;
}

.ai-row {
    display: flex !important;
    align-items: flex-end !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
}

    .ai-row.right {
        justify-content: flex-end !important;
    }

.ai-bubble {
    max-width: 78% !important;
    padding: 11px 14px !important;
    border-radius: 16px !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
    white-space: pre-line !important;
}

    .ai-bubble.bot {
        background: #eef2f7 !important;
        color: #111827 !important;
        border-bottom-left-radius: 4px !important;
    }

    .ai-bubble.user {
        background: #007bff !important;
        color: white !important;
        border-bottom-right-radius: 4px !important;
    }

.ai-quick {
    display: flex !important;
    gap: 6px !important;
    padding: 10px 12px !important;
    background: white !important;
    border-top: 1px solid #e5e7eb !important;
    overflow-x: auto !important;
}

    .ai-quick button {
        border: 1px solid #dbeafe !important;
        background: #eff6ff !important;
        color: #1d4ed8 !important;
        border-radius: 999px !important;
        padding: 5px 10px !important;
        font-size: 12px !important;
        cursor: pointer !important;
        white-space: nowrap !important;
    }

.ai-chat-footer {
    padding: 14px !important;
    display: flex !important;
    gap: 10px !important;
    border-top: 1px solid #e5e7eb !important;
    background: white !important;
}

    .ai-chat-footer input {
        flex: 1 !important;
        border: 1px solid #d1d5db !important;
        border-radius: 10px !important;
        padding: 10px 12px !important;
        outline: none !important;
        min-width: 0 !important;
    }

    .ai-chat-footer button {
        width: 48px !important;
        min-width: 48px !important;
        border: none !important;
        border-radius: 10px !important;
        background: #007bff !important;
        color: white !important;
    }
.ai-setting-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,.45) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999999 !important;
}

.ai-setting-modal {
    background: #fff !important;
    width: 420px !important;
    max-width: 92vw !important;
    border-radius: 14px !important;
    padding: 22px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,.3) !important;
}

.ai-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

    .ai-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.ai-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #e5e7eb;
    transition: .3s;
    border-radius: 34px;
    box-shadow: inset 0 0 4px rgba(0,0,0,.15);
}

    .ai-slider:before {
        position: absolute;
        content: "";
        height: 22px;
        width: 22px;
        left: 3px;
        bottom: 3px;
        background: white;
        transition: .3s;
        border-radius: 50%;
    }

.ai-switch input:checked + .ai-slider {
    background-color: #22c55e;
}

    .ai-switch input:checked + .ai-slider:before {
        transform: translateX(24px);
    }
/* Mobile / MAUI WebView */
@media (max-width: 768px) {
    .ai-widget {
        right: 16px !important;
        bottom: 75px !important;
    }

    .ai-float-btn {
        width: 50px !important;
        height: 50px !important;
        padding: 4px !important;
    }

        .ai-float-btn img {
            width: 42px !important;
            height: 42px !important;
            max-width: 42px !important;
            max-height: 42px !important;
        }

    .ai-chat-window {
        position: fixed !important;
        right: 10px !important;
        bottom: 135px !important;
        width: calc(100vw - 20px) !important;
        height: 70vh !important;
        max-width: none !important;
    }

    .ai-chat-header {
        height: 58px !important;
        padding: 0 12px !important;
    }

    .ai-title {
        font-size: 15px !important;
        gap: 8px !important;
    }

        .ai-title img,
        .ai-avatar {
            width: 28px !important;
            height: 28px !important;
            max-width: 28px !important;
            max-height: 28px !important;
        }

    .ai-chat-body {
        padding: 12px !important;
    }
}
    /*NOTIFICATION*/
.notif-dropdown-pro {
    width: 450px !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 18px !important;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .20);
}

.notif-header-pro {
    padding: 18px 22px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-title-main {
    font-size: 23px;
    font-weight: 700;
    color: #0f172a;
}

.notif-subtitle {
    margin-top: 3px;
    font-size: 14px;
    color: #64748b;
}

.notif-mark-read {
    font-size: 14px;
    color: #2563eb;
    text-decoration: none;
}

.notif-scroll-area {
    max-height: 430px;
    overflow-y: auto;
    background: #fff;
}

.notif-row-pro {
    display: flex;
    gap: 16px;
    padding: 18px 22px;
    text-decoration: none;
    color: #1f2937;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
}

    .notif-row-pro:hover {
        background: #f8fafc;
        color: #1f2937;
        text-decoration: none;
    }

    .notif-row-pro.unread {
        background: #f8fbff;
    }

.notif-icon-pro {
    width: 54px;
    height: 54px;
    min-width: 54px;
    border-radius: 50%;
    background: #eaf2ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.notif-info-pro {
    flex: 1;
    min-width: 0;
}

.notif-row-title {
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 5px;
}

.notif-row-message {
    font-size: 15px;
    color: #64748b;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-row-date {
    margin-top: 9px;
    font-size: 13px;
    color: #94a3b8;
}

.notif-status-area {
    min-width: 72px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
}

.notif-dot {
    width: 9px;
    height: 9px;
    background: #2563eb;
    border-radius: 50%;
    margin-top: 6px;
}

.notif-new-badge {
    background: #dcfce7;
    color: #15803d;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.notif-footer-pro {
    display: block;
    padding: 16px;
    text-align: center;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    color: #2563eb;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
}

    .notif-footer-pro:hover {
        background: #f8fafc;
        color: #1d4ed8;
        text-decoration: none;
    }

.notif-empty-pro {
    padding: 40px;
    text-align: center;
    color: #94a3b8;
}

    .notif-empty-pro i {
        font-size: 32px;
        margin-bottom: 10px;
    }

/* Scrollbar */
.notif-scroll-area::-webkit-scrollbar {
    width: 7px;
}

.notif-scroll-area::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.notif-scroll-area::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

    .notif-scroll-area::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

/*USER ONLINE*/
.online-page {
    padding-top: 20px;
}

.online-page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 26px;
}

    .online-page-head h3 {
        font-size: 28px;
        font-weight: 800;
        color: #0f172a;
        margin-bottom: 4px;
    }

    .online-page-head p {
        color: #64748b;
        margin: 0;
    }

.online-refresh {
    border: 1px solid #dbe3ef;
    color: #2563eb;
    font-weight: 700;
    border-radius: 10px;
    padding: 9px 18px;
}

.online-stat-card {
    background: #fff;
    border-radius: 18px;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 126px;
    border: 1px solid #eef2f7;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
    transition: .25s ease;
}

    .online-stat-card.value-up {
        animation: onlineUp .8s ease;
    }

    .online-stat-card.value-down {
        animation: onlineDown .8s ease;
    }

@keyframes onlineUp {
    0% {
        transform: translateY(0);
        box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
    }

    40% {
        transform: translateY(-8px);
        box-shadow: 0 18px 38px rgba(34, 197, 94, .25);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes onlineDown {
    0% {
        transform: translateY(0);
        box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
    }

    40% {
        transform: translateY(8px);
        box-shadow: 0 18px 38px rgba(239, 68, 68, .22);
    }

    100% {
        transform: translateY(0);
    }
}


.online-stat-icon {
    width: 62px;
    height: 62px;
    min-width: 62px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

    .online-stat-icon.blue {
        background: #dbeafe;
        color: #2563eb;
    }

    .online-stat-icon.green {
        background: #dcfce7;
        color: #16a34a;
    }

    .online-stat-icon.purple {
        background: #ede9fe;
        color: #7c3aed;
    }

.online-stat-label {
    color: #475569;
    font-weight: 700;
    font-size: 14px;
}

.online-stat-value {
    color: #0f172a;
    font-size: 32px;
    font-weight: 900;
    line-height: 1.1;
}

.online-stat-card small {
    color: #64748b;
}

.online-table-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid #eef2f7;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
    overflow: hidden;
}

.online-table-head {
    padding: 20px 22px;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .online-table-head h5 {
        margin: 0;
        font-weight: 800;
        color: #0f172a;
    }

    .online-table-head small,
    .online-last-update {
        color: #64748b;
        font-size: 13px;
    }

.online-table {
    margin-bottom: 0;
}

    .online-table thead th {
        background: #f8fafc;
        color: #475569;
        font-size: 13px;
        font-weight: 800;
        padding: 15px;
        border-bottom: 1px solid #e5e7eb;
    }

    .online-table tbody td {
        padding: 15px;
        vertical-align: middle;
        color: #334155;
        border-bottom: 1px solid #f1f5f9;
    }

.online-row {
    animation: rowFade .35s ease;
}

@keyframes rowFade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.online-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.online-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #dbeafe;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.online-role {
    background: #f3e8ff;
    color: #7e22ce;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.online-client {
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

    .online-client.web {
        background: #dbeafe;
        color: #2563eb;
    }

    .online-client.maui {
        background: #dcfce7;
        color: #16a34a;
    }

.online-status {
    background: #dcfce7;
    color: #15803d;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

    .online-status span {
        width: 8px;
        height: 8px;
        background: #22c55e;
        border-radius: 50%;
        box-shadow: 0 0 0 5px rgba(34,197,94,.18);
    }

/*html,
body {
    height: 100%;
    overflow-x: hidden;
    background: #f4f6f9 !important;
}

.wrapper {
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    background: #f4f6f9 !important;
}

.content-wrapper {
    flex: 1 0 auto !important;
    min-height: 0 !important;
    background: #f4f6f9 !important;
}

.main-footer {
    flex-shrink: 0 !important;
    margin-top: auto !important;
    background: #fff !important;
}

.main-sidebar {
    height: auto !important;
    min-height: 100% !important;
}*/

html,
body {
    height: 100%;
    overflow-x: hidden;
    background: #f4f6f9 !important;
}

.wrapper {
    min-height: 100vh !important;
    background: #f4f6f9 !important;
}

/* CONTENT */
.content-wrapper {
    min-height: calc(100vh - 57px - 57px) !important;
    background: #f4f6f9 !important;
    padding-bottom: 20px !important;
}

/* FOOTER */
.main-footer {
    background: #fff !important;
}

/* SIDEBAR */
.main-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    overflow-y: hidden !important;
}

    /* yang scroll adalah isi sidebar */
    .main-sidebar .sidebar {
        height: calc(100vh - 80px) !important;
        overflow-y: auto !important;
        padding-top: 10px !important;
        padding-bottom: 30px !important;
    }

    .main-sidebar .brand-link {
        height: 73px !important;
        display: flex !important;
        align-items: center !important;
    }

.chart-card {
    background: white;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,.05);
    border: 1px solid #edf2f7;
}

    .chart-card canvas {
        min-height: 380px;
    }