:root {
    /* Dark */
    /* --bg-primary: #0a0e1a;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #252b3d;
    --text-primary: #ffffff;
    --text-secondary: #8892b0;
    --text-muted: #64748b;
    --accent-cyan: #00d4ff;
    --accent-purple: #8b5cf6;
    --accent-warning: #f59e0b;
    --accent-success: #10b981;
    --accent-danger: #ef4444;
    --border-color: #334155;
    --hover-bg: #374151; */

    /* Light */
    --primary-color   : #0f0064;

    --bg-secondary    : #fcfcfc;
    --bg-tertiary     : #f8f8f8;
    --text-primary    : #0f0064;
    --text-secondary  : #002184;
    --text-muted      : #64748b;
    --accent-cyan     : #0019c8;
    --accent-purple   : #8b5cf6;
    --accent-warning  : #f59e0b;
    --accent-success  : #10b981;
    --accent-danger   : #ef4444;
    --border-color    : #f2f2f2;
    --hover-bg        : #ededed;

    --body-bg         : #ffffff;
    --body-color      : var(--primary-color);

    --navbar-bg       : var(--primary-color);
    --navbar-border   : #f2f2f2;
    --navbar-text-color: #ffffff;

    --scrollbar-bg    : #fcfcfc;
    --scrollbar-color : var(--primary-color);
    --scrollbar-hover : #002184;

    --table-head-bg   : var(--primary-color);
    --table-head-text : #ffffff;

}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--body-bg);
    color: var(--body-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

/* Header Styles */

/* Navbar */
.navbar {
    /* background-color: var(--bg-secondary) !important; */
    background-color: var(--navbar-bg) !important;
    border-bottom: 1px solid var(--navbar-border);
    padding: 1rem 1.5rem;
}

.logo-icon {
    color: var(--accent-cyan);
    font-size: 1.5rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navbar-text-color);
    letter-spacing: 1px;
}

.search-container {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.search-input {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border-radius: 8px;
    width: 100%;
}

.search-input:focus {
    background-color: var(--bg-tertiary);
    border-color: var(--accent-cyan);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 212, 255, 0.25);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 10;
}

.header-btn {
    position: relative;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.header-btn:hover {
    background-color: var(--hover-bg);
    color: var(--accent-cyan) !important;
}

.notification-dot {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 8px;
    height: 8px;
    background-color: var(--accent-danger);
    border-radius: 50%;
}

.user-avatar img {
    width: 32px;
    height: 32px;
    border: 2px solid var(--accent-cyan);
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 76px;
    bottom: 0;
    left: 0;
    z-index: 1000;
    padding: 0;
    /* background-color: var(--bg-secondary); */
    background: linear-gradient(to bottom, var(--primary-color), var(--primary-color), var(--bg-secondary));
    border-right: 1px solid var(--border-color);
    width: 250px;
    /* margin: 10px 10px 20px 0px !important; */
    /* border-radius: 0 30px 30px 0; */
    margin: 3px 10px 20px 0px !important;
    border-radius: 0 15px 15px 0;
    box-shadow: 0 0 10px #00000014;
}

.sidebar::before,
.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(
            45deg,
            rgba(255, 255, 255, 0.1) 0px,
            rgba(255, 255, 255, 0.1) 2px,
            transparent 2px,
            transparent 20px
        ),
        repeating-linear-gradient(
            -45deg,
            rgba(255, 255, 255, 0.05) 0px,
            rgba(255, 255, 255, 0.05) 2px,
            transparent 2px,
            transparent 20px
        );
    /* z-index: 1; */
}

/* .sidebar-sticky {
    position: sticky;
    top: 0;
    height: calc(100vh - 76px);
    padding: 1.5rem 0;
    overflow-y: auto;
} */
.sidebar-sticky {
    position: relative; /* changed from sticky */
    top: 0;
    height: calc(100vh - 76px); /* already good */
    overflow-y: auto; /* must be enabled */
    padding: 1rem 0;
}

.sidebar .nav-link {
    /* color: var(--text-secondary); */
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    border-left: 3px solid transparent;
}

/* .sidebar .nav-link:hover {
    color: var(--text-primary);
    background-color: var(--hover-bg);
    border-left-color: var(--accent-cyan);
} */
.sidebar .nav-link:hover {
    color: white;
    background-color: #ffffff52;
    border-left-color: white;
    border-radius: 0 50px 50px 0;
}

/* .sidebar .nav-link.active {
    color: var(--accent-cyan);
    background-color: var(--bg-tertiary);
    border-left-color: var(--accent-cyan);
} */
 .sidebar .nav-link.active {
    color: white;
    background-color: #ffffff52;
    border-left-color: white;
    border-radius: 0 50px 50px 0;
 }

.sidebar .nav-link i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

/* Main Content */
.main-content {
    margin: 10px 0px;
    margin-left: 250px !important;
    padding: 2rem 1rem;
    height: calc(100vh - 76px);
    overflow-x: hidden;
    overflow-y: auto;
}

.section-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.text-cyan {
    color: var(--accent-cyan) !important;
}

.live-indicator {
    display: flex;
    align-items: center;
    color: var(--accent-success);
    font-size: 0.875rem;
    font-weight: 600;
}

.live-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-success);
    border-radius: 50%;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.refresh-btn {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.refresh-btn:hover {
    background-color: var(--hover-bg);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* Metric Cards */
.metric-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    height: 100%;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.15);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.metric-title {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-icon {
    color: var(--accent-cyan);
    font-size: 1.25rem;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.metric-details {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.metric-chart {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    opacity: 0.3;
}

/* Chart Container */
.chart-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.chart-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.chart-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.chart-tab:hover {
    color: var(--text-primary);
    background-color: var(--hover-bg);
}

.chart-tab.active {
    color: var(--accent-cyan);
    background-color: var(--bg-tertiary);
}

.chart-legend {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.cpu { background-color: var(--accent-cyan); }
.legend-dot.memory { background-color: var(--accent-purple); }
.legend-dot.network { background-color: var(--accent-success); }

.chart-wrapper {
    height: 300px;
    position: relative;
}

/* Right Sidebar */
.right-sidebar {
    position: fixed;
    top: 76px;
    right: 0;
    width: 300px;
    height: calc(100vh - 76px);
    background-color: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    overflow: hidden;
}

/* Time Widget */
.time-widget {
    text-align: center;
    background-color: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.system-time-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.system-time {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-cyan);
    font-family: 'Courier New', monospace;
    margin-bottom: 0.25rem;
}

.system-date {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.time-details {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.time-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.time-detail-row:last-child {
    margin-bottom: 0;
}

.time-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.time-value {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Quick Actions */
.quick-actions {
    background-color: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.quick-actions-title {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: center;
    height: 80px;
}

.quick-action-btn i {
    font-size: 1.25rem;
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 1050;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--accent-cyan);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}
.nav-mobile-menu-toggle {
    z-index: 1050;
    background: var(--navbar-bg);
    border: none;
    color: var(--navbar-text-color);
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0 !important;
        padding: 1rem;
    }

    .right-sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-left: none;
        border-top: 1px solid var(--border-color);
        margin-top: 2rem;
    }

    .sidebar {
        margin-left: -250px;
        transition: margin-left 0.3s ease;
    }

    .sidebar.show {
        margin-left: 0;
    }

    .search-container {
        max-width: 200px;
    }
}

@media (max-width: 767.98px) {
    .navbar {
        padding: 0.75rem 1rem;
    }

    .logo-text {
        font-size: 1rem;
    }

    .search-container {
        max-width: 150px;
    }

    .search-input {
        padding: 0.5rem 0.75rem 0.5rem 2rem;
        font-size: 0.875rem;
    }

    .metric-card {
        padding: 1rem;
    }

    .metric-value {
        font-size: 2rem;
    }

    .chart-container {
        padding: 1rem;
    }

    .chart-wrapper {
        height: 250px;
    }

    .time-widget {
        padding: 1rem;
    }

    .system-time {
        font-size: 1.5rem;
    }

    .quick-action-btn {
        height: 70px;
        padding: 0.75rem 0.25rem;
    }
}

@media (max-width: 575.98px) {
    .main-content {
        padding: 0.5rem;
    }

    .chart-legend {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .metric-card {
        margin-bottom: 1rem;
    }

    .right-sidebar {
        padding: 1rem;
    }

    .quick-actions .row {
        --bs-gutter-x: 0.5rem;
    }
}

/* Custom Scrollbar */
.sidebar-sticky::-webkit-scrollbar,
.main-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-sticky::-webkit-scrollbar-track,
.main-content::-webkit-scrollbar-track {
    background: var(--scrollbar-bg);
    padding: 30px 0 !important;
    margin: 30px 0 50px !important;
}

.sidebar-sticky::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb {
    background: var(--scrollbar-color);
    border-radius: 3px;
}

.sidebar-sticky::-webkit-scrollbar-thumb:hover,
.main-content::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-hover);
}

/* Utility Classes */
.text-purple { color: var(--accent-purple) !important; }
.text-warning { color: var(--accent-warning) !important; }
.text-success { color: var(--accent-success) !important; }
.text-danger { color: var(--accent-danger) !important; }

/* Animation Classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.metric-card {
    animation: fadeInUp 0.6s ease-out;
}

.metric-card:nth-child(1) { animation-delay: 0.1s; }
.metric-card:nth-child(2) { animation-delay: 0.2s; }
.metric-card:nth-child(3) { animation-delay: 0.3s; }

/* Datatable CSS */
table.dataTable>thead>tr>th,
table.dataTable>thead>tr>td,
table.dataTable>tbody>tr>td {
    font-size: 14px;
}
table.dataTable>thead>tr>th, table.dataTable>thead>tr>td {
    background: var(--table-head-bg);
    color: var(--table-head-text);
}

.table-responsive::-webkit-scrollbar {
    width: 1px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0px;
}

.active>.page-link, .page-link.active {
    color: var(--primary-color);
    border: none;
    background: white;
}
.active>.page-link, .page-link.active {
    background: var(--primary-color);
    border: none;
    color: white;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    border: 1px solid white;
    background: white;
}
.page-link {
    font-size: 14px;
}
.page-link:hover {
    background: var(--primary-color);
    color: white;
}

/* Bootstrap  */
.btn {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: white;
}

.select2-container {
    width: 100% !important;
}

/* Adjust size */
.form-check-input.toggle-switch {
    width: 2.5em;
    height: 1.4em;
    appearance: none;
    background-color: #dc3545; /* default red for inactive */
    border: 1px solid #dc3545;
    border-radius: 2em;
    position: relative;
    transition: background-color 0.3s, border-color 0.3s;
}

/* White circle */
.form-check-input.toggle-switch::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 13px;
    height: 13px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}

/* Green active state */
.form-check-input.toggle-switch.switch-active {
    background-color: #28a745;
    border-color: #28a745;
}

.form-check-input.toggle-switch.switch-active:checked::before {
    transform: translateX(1.1em);
}

/* Red inactive state */
.form-check-input.toggle-switch.switch-inactive {
    background-color: #dc3545;
    border-color: #dc3545;
}

.form-check-input.toggle-switch.switch-inactive:checked::before {
    transform: translateX(1.1em);
}

.gradient-light-sky {
    background: linear-gradient(180deg, #cad9ff, #f4feff);
}
.gradient-light-lavender {
    background: linear-gradient(180deg, #e2d4ff, #f4feff);
}
.gradient-light-cyan {
    background: linear-gradient(180deg, #d4faff, #f4feff);
}

.btn-warning {
    background-color: #ebdb2a;
    border-radius: 4px;
    outline: none;
    border: none;
    color: rgb(0, 0, 0);
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
  }
  .btn-warning:hover {
    background-color: #ffed26;
  }
  .btn-danger {
    background-color: #b70606;
    border-radius: 4px;
    outline: none;
    border: none;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
  }
  .btn-danger:hover {
    background-color: #ff2e2e;
  }
  .btn-info {
    background-color: #10d7d4;
    border-radius: 4px;
    outline: none;
    border: none;
    color: rgb(0, 0, 0);
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
  }
  .btn-info:hover {
    background-color: #78fff1;
  }
  .btn-success {
    background-color: #48cc06;
    border-radius: 4px;
    outline: none;
    border: none;
    color: rgb(255, 255, 255);
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
  }
  .btn-success:hover {
    background-color: #79fa88;
  }
  