@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700&display=swap');
:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    --text-main: #2b2d42;
    --text-muted: #8d99ae;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 25px rgba(67, 97, 238, 0.15);
    --border-radius: 16px;
    --sidebar-width: 260px;
}
body { font-family: 'Outfit', sans-serif; background-color: var(--bg-body); color: var(--text-main); overflow-x: hidden; }

/* ANIMATION */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-up { animation: fadeInUp 0.6s ease-out forwards; opacity: 0; }
.delay-1 { animation-delay: 0.1s; } .delay-2 { animation-delay: 0.2s; } .delay-3 { animation-delay: 0.3s; }

/* SIDEBAR & NAV */
#wrapper { overflow-x: hidden; min-height: 100vh; }
#sidebar-wrapper { min-height: 100vh; width: var(--sidebar-width); margin-left: 0; position: fixed; z-index: 1000; top: 0; left: 0; bottom: 0; background: #ffffff; border-right: 1px solid #e9ecef; transition: margin 0.25s ease-out; overflow-y: auto; }
#page-content-wrapper { width: 100%; margin-left: var(--sidebar-width); transition: margin 0.25s ease-out; }

.brand-wrapper-vertical { 
    padding: 2rem 1.5rem; 
    border-bottom: 1px solid rgba(0,0,0,0.05); 
    background: #ffffff; 
    position: relative;
    overflow: hidden;
    text-align: center;
}
.brand-wrapper-vertical::before {
    content: "";
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(67, 97, 238, 0.05) 0%, transparent 70%);
    z-index: 1;
}
.brand-wrapper-vertical::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(67, 97, 238, 0.2), transparent);
    animation: scanline 4s linear infinite;
    z-index: 2;
}
@keyframes scanline {
    0% { top: 0; }
    100% { top: 100%; }
}
.brand-text-center {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.brand-title-shimmer-large {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: 3px;
    background: linear-gradient(90deg, #4361ee, #4cc9f0, #4361ee);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer-text 4s linear infinite;
    line-height: 1;
    margin-bottom: 10px;
}
.brand-subtitle-v2 {
    font-size: 0.62rem;
    color: #8d99ae;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.4;
}
.brand-icon-pulsing {
    position: relative;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #4361ee, #4cc9f0);
    border-radius: 16px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    z-index: 4;
    margin-bottom: 1rem;
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.2);
}
.pulse-wave {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 16px;
    border: 2px solid rgba(67, 97, 238, 0.3);
    z-index: -1;
    animation: brand-pulse-v2 2s infinite;
}
@keyframes brand-pulse-v2 {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* HEADER - VIBRANT PROFESSIONAL GRADIENT */
.navbar-gradient { 
    background: linear-gradient(135deg, #4361ee 0%, #3f37c9 50%, #4895ef 100%); 
    position: relative;
    overflow: hidden;
    color: white !important; 
    border-bottom: none; 
    box-shadow: 0 4px 25px rgba(67, 97, 238, 0.25); 
}
.navbar-gradient::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 0%, transparent 50%),
                      radial-gradient(circle at 80% 70%, rgba(76, 201, 240, 0.15) 0%, transparent 50%);
    pointer-events: none;
}
.navbar-gradient .page-title {
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.navbar-gradient .page-subtitle {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    font-size: 0.8rem;
}
.cursor-pointer { cursor: pointer !important; }
.status-pill { 
    background: rgba(255, 255, 255, 0.15); 
    padding: 8px 20px; 
    border-radius: 50px; 
    border: 1px solid rgba(255, 255, 255, 0.25); 
    font-size: 0.8rem; 
    font-weight: 700; 
    color: white; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    backdrop-filter: blur(8px); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.dot-online { 
    width: 10px; height: 10px; 
    background: #00f5d4; 
    border-radius: 50%; 
    box-shadow: 0 0 12px #00f5d4; 
    animation: pulse-teal 2s infinite;
}
@keyframes pulse-teal {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

/* KPI CARDS - COMPACT VERSION */
.kpi-card { 
    background: white; 
    border-radius: 16px; 
    padding: 16px 20px; 
    box-shadow: 0 8px 25px rgba(0,0,0,0.03); 
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); 
    border: 1px solid rgba(0,0,0,0.02); 
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.kpi-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 15px 35px rgba(67, 97, 238, 0.08); 
}

/* TECH EMBLEMS - COMPACT */
.kpi-icon-emblem {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    animation: emblem-float 3s ease-in-out infinite;
    z-index: 2;
}
.kpi-icon-emblem::before {
    content: "";
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(45deg, var(--primary-color), transparent, var(--accent-color));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: emblem-spin 4s linear infinite;
}

@keyframes emblem-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes emblem-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.emblem-blue { color: #4361ee; }
.emblem-blue::before { background: linear-gradient(45deg, #4361ee, #4cc9f0); }
.emblem-yellow { color: #ffca3a; }
.emblem-yellow::before { background: linear-gradient(45deg, #ffca3a, #ff9f1c); }
.emblem-red { color: #ff595e; }
.emblem-red::before { background: linear-gradient(45deg, #ff595e, #e71d36); }
.emblem-green { color: #2ec4b6; }
.emblem-green::before { background: linear-gradient(45deg, #2ec4b6, #06d6a0); }

.kpi-bg-icon {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 5rem;
    opacity: 0.03;
    transform: rotate(-15deg);
    z-index: -1;
    transition: all 0.4s ease;
}
.kpi-card:hover .kpi-bg-icon {
    transform: scale(1.2) rotate(0deg);
    opacity: 0.1;
}

.card-blue { border-top: 5px solid var(--primary-color); }
.card-yellow { border-top: 5px solid #ffca3a; }
.card-red { border-top: 5px solid #ff595e; }
.card-green { border-top: 5px solid #2ec4b6; }

.kpi-header span { font-size: 0.65rem; font-weight: 800; color: #8d99ae; letter-spacing: 1.2px; text-transform: uppercase; }
.kpi-body h2 { font-size: 1.8rem; font-weight: 800; color: #2b2d42; margin: 6px 0; font-family: 'Outfit', sans-serif; }

/* SIDEBAR TOOLS & FILTERS - CONTROL CENTER STYLE */
.menu-section { margin-bottom: 2rem; }
.menu-label { 
    font-size: 0.65rem; 
    font-weight: 800; 
    color: #cbd5e0; 
    letter-spacing: 2px; 
    margin-left: 15px;
    margin-bottom: 15px;
    display: block;
}
.menu-item { 
    display: flex; 
    align-items: center; 
    padding: 12px 18px; 
    color: #4a5568; 
    text-decoration: none; 
    border-radius: 14px; 
    transition: all 0.3s; 
    font-weight: 600; 
    margin-bottom: 8px;
    border: 1px solid transparent;
}
.menu-item i { 
    font-size: 1.25rem; 
    margin-right: 15px; 
    color: #a0aec0;
    transition: all 0.3s;
}
.menu-item:hover { 
    background: #ffffff; 
    color: var(--primary-color); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-color: rgba(67, 97, 238, 0.1);
    transform: translateX(5px);
}
.menu-item:hover i { color: var(--primary-color); transform: scale(1.1); }

.btn-time { 
    background: #f8fafc; 
    border: 1px solid #edf2f7; 
    color: #718096; 
    padding: 10px 18px; 
    border-radius: 12px; 
    text-align: left; 
    font-size: 0.85rem; 
    font-weight: 600; 
    transition: all 0.3s; 
    width: 100%; 
    display: flex;
    align-items: center;
    gap: 12px; /* Jarak tetap antar ikon dan teks */
}
.btn-time i { font-size: 1.1rem; opacity: 0.7; width: 20px; text-align: center; } /* Lebar ikon tetap agar teks sejajar */
.btn-time:hover { background: #ffffff; color: var(--primary-color); border-color: var(--primary-color); }
.btn-time.active { 
    background: #ffffff; 
    color: var(--primary-color); 
    border-color: var(--primary-color); 
    box-shadow: inset 0 2px 4px rgba(67, 97, 238, 0.05), 0 10px 20px rgba(67, 97, 238, 0.1);
    position: relative;
}
.btn-time.active::after {
    content: "";
    position: absolute;
    left: -15px; top: 20%; bottom: 20%;
    width: 4px;
    background: var(--primary-color);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--primary-color);
}

.btn-custom-date {
    background: rgba(67, 97, 238, 0.03);
    border: 1px dashed rgba(67, 97, 238, 0.3);
    color: var(--primary-color);
    font-weight: 700;
}
.btn-custom-date:hover {
    background: rgba(67, 97, 238, 0.08);
}

/* MODERN GRID TABLE REFINED */
.modern-grid-table { border-collapse: separate; border-spacing: 0 6px; }
.modern-grid-table thead th { 
    background: #f8f9fa !important; 
    border: none !important; 
    font-weight: 800; 
    color: #2b2d42; 
    font-size: 0.8rem; 
    padding: 12px 20px; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.modern-grid-table tbody tr { background: white; box-shadow: 0 1px 4px rgba(0,0,0,0.03); transition: all 0.2s ease; border-radius: 8px; }
.modern-grid-table tbody tr:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.modern-grid-table td { padding: 10px 20px !important; border: none !important; font-size: 0.82rem; }
.modern-grid-table td:first-child { border-radius: 8px 0 0 8px; }
.modern-grid-table td:last-child { border-radius: 0 8px 8px 0; }

.status-indicator-glow { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.glow-success { background: #2ec4b6; box-shadow: 0 0 10px rgba(46, 196, 182, 0.6); }
.glow-warning { background: #ff9f1c; box-shadow: 0 0 10px rgba(255, 159, 28, 0.6); }
.glow-danger { background: #e71d36; box-shadow: 0 0 10px rgba(231, 29, 54, 0.6); }
.glow-offline { background: #adb5bd; box-shadow: 0 0 10px rgba(173, 181, 189, 0.6); }

.trend-badge { padding: 4px 10px; border-radius: 50px; font-size: 0.75rem; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.trend-up { background: rgba(231, 29, 54, 0.1); color: #e71d36; }
.trend-down { background: rgba(46, 196, 182, 0.1); color: #2ec4b6; }
.trend-stable { background: rgba(173, 181, 189, 0.1); color: #6c757d; }

.val-text-bold { font-weight: 800; font-size: 1.05rem; color: #2b2d42; font-family: 'Outfit', sans-serif; }
.unit-text { font-size: 0.7rem; font-weight: 600; color: #8d99ae; margin-left: 2px; }

/* FILTER & MAP */
.filter-bar { background: white; padding: 15px 20px; border-radius: var(--border-radius); box-shadow: var(--shadow-soft); display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.filter-label { font-weight: 700; color: var(--text-main); font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.filter-label i { color: var(--primary-color); }
.form-select-tech { background-color: #f8f9fa; border: 1px solid #e9ecef; color: #2b2d42; font-size: 0.85rem; font-weight: 500; padding: 6px 12px; border-radius: 8px; width: 100%; transition: all 0.2s; }
.form-select-tech:focus { border-color: var(--primary-color); outline: none; box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1); }
.tech-card { background: white; border-radius: var(--border-radius); box-shadow: var(--shadow-soft); overflow: hidden; border: 1px solid #f0f0f0; }
.card-head { padding: 15px 20px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.card-head h5 { margin: 0; font-size: 1rem; font-weight: 700; color: #2b2d42; }
.card-content { padding: 20px; }
.btn-icon { background: #f8f9fa; border: none; width: 30px; height: 30px; border-radius: 8px; color: #8d99ae; transition: 0.2s; }
.btn-icon:hover { background: #4361ee; color: white; }
.chart-container { position: relative; width: 100%; min-height: 400px; }
#map { border-radius: 8px; overflow: hidden; }
.map-legend-box { padding: 10px; background: #fdfdfd; border-top: 1px solid #eee; height: 80px; overflow-y: auto; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.legend-item { font-size: 0.7rem; background: white; padding: 4px 10px; border-radius: 20px; border: 1px solid #eee; display: flex; align-items: center; gap: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.03); }

/* WEATHER MARKER */
.map-weather-tag {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: white; padding: 4px 10px; border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15); font-size: 0.8rem; font-weight: 700;
    color: #333; white-space: nowrap; text-align: center; border: 1px solid #eee;
    z-index: 1000; display: flex; align-items: center; gap: 5px;
}
.map-weather-tag i { font-size: 1.1rem; }
.custom-pin { 
    width: 24px; height: 24px; border-radius: 50% 50% 50% 0; 
    transform: rotate(-45deg); border: 2px solid white; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.3); position: relative; z-index: 2; 
}
.pulse-ring { 
    position: absolute; top: 50%; left: 50%; 
    transform: translate(-50%, -50%); width: 45px; height: 45px; 
    border-radius: 50%; border: 3px solid; 
    animation: pulsate 2.5s infinite ease-out; opacity: 0; z-index: 1; 
}
@keyframes pulsate { 0% { transform: translate(-50%, -50%) scale(0.1); opacity: 0.8; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 0; } }

/* RESPONSIVE */
@media (max-width: 768px) {
    #sidebar-wrapper { margin-left: -260px; }
    #page-content-wrapper { margin-left: 0; }
    #sidebar-wrapper.show-sidebar-mobile { margin-left: 0; }
    .kpi-value-small { font-size: 1.4rem; }
    .chart-container { height: 350px !important; }
    #map { min-height: 250px !important; }
}
.footer-sidebar { text-align: center; margin-top: 50px; font-size: 0.7rem; color: #ccc; }
.icon-box-glow { width: 40px; height: 40px; background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); border-radius: 12px; color: white; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3); }
.status-excellent { color: #2ec4b6 !important; }
.status-good { color: #4361ee !important; }
.status-warning { color: #ff9f1c !important; }
.status-critical { color: #e71d36 !important; }

/* GLASS MODAL EFFECT */
.glass-modal {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}
.hi-gauge-container {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
}
.hi-value {
    letter-spacing: -2px;
}
.small-text { font-size: 0.7rem; }
.fw-800 { font-weight: 800; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 1px; }

.pin-bar {
    height: 6px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
}
.pin-progress {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s ease-in-out;
}

/* OFFLINE ASSET STYLES */
.offline-group-header {
    background: rgba(231, 29, 54, 0.05);
    padding: 10px 15px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: #e71d36;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid #e71d36;
}
.offline-item {
    background: #ffffff;
    padding: 12px 20px;
    border-radius: 14px;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}
.offline-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-color: rgba(231, 29, 54, 0.2);
}
.offline-asset-info {
    display: flex;
    flex-direction: column;
}
.offline-asset-name { font-weight: 700; color: #2b2d42; font-size: 0.9rem; }
.offline-asset-tag { font-size: 0.7rem; color: #8d99ae; font-weight: 600; }
.offline-badge {
    background: #f8d7da;
    color: #721c24;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 50px;
    text-transform: uppercase;
}
.pulse-offline {
    width: 8px; height: 8px;
    background: #e71d36;
    border-radius: 50%;
    animation: offline-pulse-v2 1.5s infinite;
}
@keyframes offline-pulse-v2 {
    0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(231, 29, 54, 0.7); }
    70% { transform: scale(1.2); opacity: 0.8; box-shadow: 0 0 0 10px rgba(231, 29, 54, 0); }
    100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(231, 29, 54, 0); }
}
