/* GACS Dashboard Custom Styles */

:root {
    --primary-color: #7C3AED;
    --primary-dark: #312E81;
    --primary-light: #A78BFA;
    --secondary-color: #64748B;
    --success-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #38BDF8;

    --dark-color: #0F172A;
    --darker-color: #020617;
    --light-color: #F8FAFC;
    --gray-100: #EEF2FF;
    --gray-200: #E0E7FF;
    --gray-300: #CBD5E1;

    --sidebar-bg: linear-gradient(180deg, #020617 0%, #111827 45%, #312E81 100%);
    --sidebar-hover: rgba(124, 58, 237, 0.25);
    --topbar-bg: #FFFFFF;

    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
}

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

html {
    height: 100%;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-100);
    min-height: 100vh;
    height: 100%;
    margin: 0;
    padding: 0;
    zoom: 80%;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100%;
    min-height: 100vh;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.08);
    transition: width 0.3s ease;
}

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

.sidebar-header {
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.sidebar-toggle {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 1.2rem;
    z-index: 1001;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar.collapsed .sidebar-toggle {
    left: 15px;
}

.sidebar.collapsed .sidebar-header {
    padding: 1rem 0.5rem;
}

.sidebar.collapsed .sidebar-header i {
    font-size: 1.8rem !important;
    margin-bottom: 0 !important;
}

.sidebar-header h3 {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
    word-wrap: break-word;
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-header h3 {
    opacity: 0;
    height: 0;
    font-size: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s;
    background: transparent;
    position: relative;
}

.sidebar.collapsed .sidebar-menu a {
    padding: 1rem 0;
    justify-content: center;
}

.sidebar-menu a:hover {
    background: var(--sidebar-hover);
    color: white;
}

.sidebar-menu a.active {
    background: var(--sidebar-hover);
    color: white;
    border-left: 4px solid var(--primary-color);
    padding-left: calc(1.25rem - 4px);
}

.sidebar.collapsed .sidebar-menu a:hover,
.sidebar.collapsed .sidebar-menu a.active {
    padding-left: 0;
    border-left: none;
    border-bottom: 3px solid var(--primary-color);
}

.sidebar-menu i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-menu i {
    margin-right: 0;
    font-size: 1.3rem;
}

.sidebar-menu span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-menu span {
    opacity: 0;
    width: 0;
    display: none;
}

/* Tooltip for collapsed sidebar */
.sidebar.collapsed .sidebar-menu a {
    position: relative;
}

.sidebar.collapsed .sidebar-menu a::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--darker-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    margin-left: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1002;
}

.sidebar.collapsed .sidebar-menu a:hover::after {
    opacity: 1;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--light-color);
    transition: margin-left 0.3s ease;
}

.main-content.collapsed {
    margin-left: var(--sidebar-collapsed-width) !important;
}

.topbar {
    background: var(--topbar-bg);
    padding: 1rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-200);
}

.topbar h4 {
    margin: 0;
    color: var(--dark-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.content-wrapper {
    padding: 2rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    background: white;
    color: var(--dark-color);
    padding: 1rem 1.5rem;
    font-weight: 600;
    border-bottom: 1px solid var(--gray-200);
}

.card-body {
    padding: 1.5rem;
}

/* Stats Cards */
.stats-grid {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: nowrap;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    flex: 1 1 0;
    min-width: 0;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    border-color: var(--gray-300);
}

.stat-card.primary {
    border-top: 3px solid var(--primary-color);
}

.stat-card.success {
    border-top: 3px solid var(--success-color);
}

.stat-card.danger {
    border-top: 3px solid var(--danger-color);
}

.stat-card.warning {
    border-top: 3px solid var(--warning-color);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.3;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.stat-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.stat-info h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-info p {
    margin: 0.25rem 0 0 0;
    color: var(--secondary-color);
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--gray-100);
}

table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--secondary-color);
}

table tbody tr:hover {
    background: var(--gray-100);
}

/* Badges */
.badge {
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.online {
    background: #D1FAE5;
    color: #065F46;
}

.badge.offline {
    background: #FEE2E2;
    color: #991B1B;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--secondary-color);
}

/* Footer */
.footer {
    background: white;
    padding: 1.5rem;
    text-align: center;
    color: var(--secondary-color);
    margin-top: 2rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-decoration: underline;
}

/* Map Styles */
#map {
    height: 600px;
    border-radius: 10px;
    overflow: hidden;
}

/* Alert Styles */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
    font-size: 0.9375rem;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border-color: #10B981;
}

.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
    border-color: #EF4444;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border-color: #F59E0B;
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border-color: #3B82F6;
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Inline spin animation for icons */
.spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* Modal Styles */
.modal-content {
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
    border-radius: 12px 12px 0 0;
}

.modal-header .modal-title {
    color: var(--dark-color);
    font-weight: 600;
    font-size: 1.125rem;
}

.modal-header .modal-title i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    background: var(--gray-100);
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
    border-radius: 0 0 12px 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        flex-wrap: wrap;
    }

    .stat-card {
        flex: 1 1 calc(50% - 0.25rem);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        flex-wrap: wrap;
    }

    .stat-card {
        flex: 1 1 100%;
    }
}


/* CECTECH ACS Pro premium polish */
body {
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.12), transparent 35%),
        radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.10), transparent 35%),
        var(--gray-100) !important;
}

.sidebar {
    box-shadow: 14px 0 40px rgba(2, 6, 23, 0.28);
}

.sidebar-header h3,
.sidebar-header span,
.sidebar-menu a span {
    letter-spacing: .2px;
}

.sidebar-menu a.active,
.sidebar-menu a:hover {
    border-left: 3px solid #A78BFA;
    background: linear-gradient(90deg, rgba(124,58,237,.34), rgba(56,189,248,.10)) !important;
}

.card {
    border: 1px solid rgba(124, 58, 237, 0.12) !important;
    border-radius: 18px !important;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08) !important;
}

.btn-primary {
    background: linear-gradient(135deg, #7C3AED, #38BDF8) !important;
    border: 0 !important;
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.25);
}

.table {
    border-radius: 14px;
    overflow: hidden;
}

.badge {
    border-radius: 999px;
}

/* ======================================================
   CECTECH ACS PRO PREMIUM THEME
   ====================================================== */

:root{
--primary-color:#7C3AED;
--primary-dark:#312E81;
--primary-light:#A78BFA;
--sidebar-width:260px;
}

/* BODY */

body{
background:
radial-gradient(circle at top left,rgba(124,58,237,.14),transparent 35%),
radial-gradient(circle at bottom right,rgba(59,130,246,.12),transparent 40%),
#eef2ff!important;
}

/* SIDEBAR */

.sidebar{
background:linear-gradient(
180deg,
#020617 0%,
#0F172A 25%,
#1E1B4B 65%,
#312E81 100%
)!important;

box-shadow:
12px 0 40px rgba(0,0,0,.35),
inset -1px 0 rgba(255,255,255,.05);

border-right:1px solid rgba(255,255,255,.05);
}

/* LOGO */

.sidebar-header{
border-bottom:1px solid rgba(255,255,255,.08)!important;
padding:24px 20px!important;
}

.sidebar-header h3{
font-weight:700!important;
letter-spacing:.5px!important;
}

/* MENU */

.sidebar-menu li{
margin:6px 12px!important;
}

.sidebar-menu a{

border-radius:12px!important;

transition:.25s!important;
}

.sidebar-menu a:hover{

background:rgba(124,58,237,.25)!important;

border-left:4px solid #8B5CF6!important;

transform:translateX(6px);
}

.sidebar-menu a.active{

background:linear-gradient(
90deg,
rgba(124,58,237,.40),
rgba(59,130,246,.18)
)!important;

border-left:4px solid #8B5CF6!important;
}

/* CARDS */

.card{

border-radius:18px!important;

border:none!important;

box-shadow:0 15px 35px rgba(15,23,42,.08)!important;
}

/* BUTTONS */

.btn-primary{

background:linear-gradient(
135deg,
#7C3AED,
#3B82F6
)!important;

border:none!important;

box-shadow:0 8px 20px rgba(124,58,237,.30)!important;
}

.btn-primary:hover{

transform:translateY(-2px);

box-shadow:0 15px 30px rgba(124,58,237,.40)!important;
}

/* TABLE */

.table{

border-radius:15px!important;

overflow:hidden!important;
}

.table thead{

background:#0F172A!important;

color:#fff!important;
}

/* BADGES */

.badge{

border-radius:50px!important;
padding:7px 12px!important;
}

/* SCROLLBAR */

::-webkit-scrollbar{
width:10px;
}

::-webkit-scrollbar-thumb{
background:#6D28D9;
border-radius:20px;
}

::-webkit-scrollbar-track{
background:#E5E7EB;
}


/* ======================================================
   CECTECH ACS PRO - DARK MODE + DASHBOARD POLISH
   ====================================================== */

.theme-toggle{
    position: fixed;
    top: 18px;
    right: 22px;
    z-index: 3000;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    border: 1px solid rgba(124,58,237,.22);
    background: linear-gradient(135deg,#7c3aed,#2563eb);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 14px 30px rgba(37,99,235,.28);
    cursor: pointer;
    transition: .25s ease;
}
.theme-toggle:hover{
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 18px 38px rgba(124,58,237,.36);
}

body.cectech-dark{
    background:
      radial-gradient(circle at top left,rgba(124,58,237,.22),transparent 34%),
      radial-gradient(circle at bottom right,rgba(14,165,233,.14),transparent 38%),
      #020617 !important;
    color: #e5e7eb !important;
}

body.cectech-dark .main-content,
body.cectech-dark .content-wrapper,
body.cectech-dark .page-content{
    background: transparent !important;
    color: #e5e7eb !important;
}

body.cectech-dark .topbar,
body.cectech-dark .navbar,
body.cectech-dark .header{
    background: rgba(15,23,42,.82) !important;
    color: #e5e7eb !important;
    border-bottom: 1px solid rgba(148,163,184,.14) !important;
    backdrop-filter: blur(18px);
}

body.cectech-dark .card,
body.cectech-dark .modal-content,
body.cectech-dark .dropdown-menu{
    background: rgba(15,23,42,.88) !important;
    color: #e5e7eb !important;
    border: 1px solid rgba(148,163,184,.15) !important;
    box-shadow: 0 20px 45px rgba(0,0,0,.35) !important;
}

body.cectech-dark .card-header,
body.cectech-dark .modal-header,
body.cectech-dark .modal-footer{
    background: rgba(2,6,23,.38) !important;
    border-color: rgba(148,163,184,.14) !important;
    color: #f8fafc !important;
}

body.cectech-dark .table{
    color: #e5e7eb !important;
}

body.cectech-dark .table td,
body.cectech-dark .table th{
    border-color: rgba(148,163,184,.14) !important;
}

body.cectech-dark .table tbody tr{
    background: rgba(15,23,42,.45) !important;
}

body.cectech-dark .table tbody tr:hover{
    background: rgba(124,58,237,.16) !important;
}

body.cectech-dark input,
body.cectech-dark select,
body.cectech-dark textarea,
body.cectech-dark .form-control,
body.cectech-dark .form-select{
    background: rgba(2,6,23,.72) !important;
    color: #e5e7eb !important;
    border-color: rgba(148,163,184,.22) !important;
}

body.cectech-dark input::placeholder,
body.cectech-dark textarea::placeholder{
    color: #94a3b8 !important;
}

body.cectech-dark a{
    color: #93c5fd;
}

body.cectech-dark .text-muted{
    color: #94a3b8 !important;
}

/* Dashboard card polish */
.stat-card,
.dashboard-card,
.card{
    transition: transform .22s ease, box-shadow .22s ease;
}
.stat-card:hover,
.dashboard-card:hover,
.card:hover{
    transform: translateY(-3px);
}

.card-title,
h1,h2,h3,h4,h5{
    letter-spacing: -.02em;
}

.badge.bg-success,
.badge-success{
    background: linear-gradient(135deg,#10b981,#059669) !important;
}
.badge.bg-danger,
.badge-danger{
    background: linear-gradient(135deg,#ef4444,#b91c1c) !important;
}
.badge.bg-warning,
.badge-warning{
    background: linear-gradient(135deg,#f59e0b,#d97706) !important;
}
.badge.bg-info,
.badge-info{
    background: linear-gradient(135deg,#38bdf8,#2563eb) !important;
}


/* CECTECH NOC DASHBOARD */
.cec-noc-hero{
    margin:18px 0 22px;
    padding:24px;
    border-radius:24px;
    background:linear-gradient(135deg,#020617,#111827 45%,#312e81);
    color:#fff;
    box-shadow:0 20px 50px rgba(15,23,42,.25);
    position:relative;
    overflow:hidden;
}
.cec-noc-hero:after{
    content:"";
    position:absolute;
    right:-80px;
    top:-80px;
    width:240px;
    height:240px;
    background:radial-gradient(circle,rgba(56,189,248,.35),transparent 65%);
}
.cec-noc-title{
    font-size:28px;
    font-weight:800;
    margin:0;
}
.cec-noc-sub{
    color:#cbd5e1;
    margin-top:6px;
}
.cec-noc-status{
    display:inline-flex;
    gap:8px;
    align-items:center;
    padding:8px 13px;
    border-radius:999px;
    background:rgba(16,185,129,.14);
    color:#86efac;
    border:1px solid rgba(16,185,129,.25);
    font-size:13px;
}
.cec-noc-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:16px;
    margin-bottom:20px;
}
.cec-kpi{
    background:#fff;
    border-radius:20px;
    padding:18px;
    box-shadow:0 12px 35px rgba(15,23,42,.08);
    border:1px solid rgba(124,58,237,.12);
    position:relative;
    overflow:hidden;
}
.cec-kpi:before{
    content:"";
    position:absolute;
    inset:0 0 auto 0;
    height:4px;
    background:linear-gradient(90deg,#7c3aed,#38bdf8);
}
.cec-kpi-icon{
    width:42px;
    height:42px;
    border-radius:15px;
    display:grid;
    place-items:center;
    background:linear-gradient(135deg,#7c3aed,#2563eb);
    color:#fff;
    box-shadow:0 8px 18px rgba(124,58,237,.25);
}
.cec-kpi-value{
    font-size:28px;
    font-weight:800;
    margin-top:12px;
}
.cec-kpi-label{
    font-size:13px;
    color:#64748b;
}
.cec-noc-panels{
    display:grid;
    grid-template-columns:1.4fr .9fr;
    gap:18px;
}
.cec-panel{
    background:#fff;
    border-radius:22px;
    padding:20px;
    box-shadow:0 12px 35px rgba(15,23,42,.08);
    border:1px solid rgba(124,58,237,.1);
}
.cec-panel h4{
    font-size:16px;
    font-weight:800;
    margin-bottom:16px;
}
.cec-health-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:13px 0;
    border-bottom:1px solid #eef2ff;
}
.cec-health-row:last-child{
    border-bottom:0;
}
.cec-dot{
    width:10px;
    height:10px;
    border-radius:50%;
    background:#10b981;
    box-shadow:0 0 0 6px rgba(16,185,129,.12);
}
.cec-topology{
    display:flex;
    justify-content:center;
    align-items:center;
    min-height:260px;
    color:#0f172a;
}
.cec-node{
    display:inline-flex;
    flex-direction:column;
    align-items:center;
    gap:7px;
    padding:14px 18px;
    border-radius:18px;
    background:linear-gradient(135deg,#eef2ff,#fff);
    border:1px solid #ddd6fe;
    box-shadow:0 10px 25px rgba(124,58,237,.12);
    margin:8px;
}
.cec-line{
    height:2px;
    background:#a78bfa;
    width:70px;
    display:inline-block;
}
.cec-feed{
    display:flex;
    flex-direction:column;
    gap:12px;
}
.cec-event{
    padding:13px;
    border-radius:16px;
    background:#f8fafc;
    border:1px solid #e2e8f0;
}
.cec-event small{
    color:#64748b;
}
body.cectech-dark .cec-kpi,
body.cectech-dark .cec-panel{
    background:rgba(15,23,42,.9)!important;
    color:#e5e7eb!important;
    border-color:rgba(148,163,184,.16)!important;
}
body.cectech-dark .cec-kpi-label,
body.cectech-dark .cec-event small{
    color:#94a3b8!important;
}
body.cectech-dark .cec-event{
    background:rgba(2,6,23,.55)!important;
    border-color:rgba(148,163,184,.14)!important;
}
body.cectech-dark .cec-health-row{
    border-color:rgba(148,163,184,.14)!important;
}
body.cectech-dark .cec-node{
    background:linear-gradient(135deg,rgba(49,46,129,.65),rgba(15,23,42,.8));
    border-color:rgba(167,139,250,.25);
    color:#fff;
}
@media(max-width:900px){
    .cec-noc-grid{grid-template-columns:repeat(2,1fr);}
    .cec-noc-panels{grid-template-columns:1fr;}
}

/* ======================================================
   CECTECH MOBILE + DARK MODE FIX
   ====================================================== */

/* Hide old bad floating button if duplicated */
.theme-toggle{
    display:none!important;
}

/* Clean dark toggle */
.cec-theme-wrap{
    position:fixed;
    top:78px;
    right:18px;
    z-index:2500;
}

.cec-theme-pill{
    display:flex;
    align-items:center;
    gap:8px;
    height:38px;
    padding:0 13px;
    border-radius:999px;
    border:1px solid rgba(124,58,237,.25);
    background:linear-gradient(135deg,#7c3aed,#2563eb);
    color:#fff;
    font-size:13px;
    font-weight:700;
    box-shadow:0 12px 28px rgba(37,99,235,.25);
}

.cec-theme-pill:active{
    transform:scale(.97);
}

/* Dark mode */
body.cectech-dark{
    background:
        radial-gradient(circle at top left,rgba(124,58,237,.20),transparent 35%),
        radial-gradient(circle at bottom right,rgba(56,189,248,.12),transparent 35%),
        #020617!important;
    color:#e5e7eb!important;
}

body.cectech-dark .main-content,
body.cectech-dark .content,
body.cectech-dark .page-content,
body.cectech-dark .content-wrapper{
    background:transparent!important;
    color:#e5e7eb!important;
}

body.cectech-dark .topbar,
body.cectech-dark .navbar,
body.cectech-dark header{
    background:rgba(15,23,42,.92)!important;
    color:#e5e7eb!important;
    border-color:rgba(148,163,184,.14)!important;
}

body.cectech-dark .card,
body.cectech-dark .cec-kpi,
body.cectech-dark .cec-panel,
body.cectech-dark .modal-content,
body.cectech-dark .dropdown-menu{
    background:rgba(15,23,42,.92)!important;
    color:#e5e7eb!important;
    border:1px solid rgba(148,163,184,.16)!important;
}

body.cectech-dark .card-header,
body.cectech-dark .card-footer,
body.cectech-dark .modal-header,
body.cectech-dark .modal-footer{
    background:rgba(2,6,23,.45)!important;
    color:#f8fafc!important;
    border-color:rgba(148,163,184,.14)!important;
}

body.cectech-dark .table,
body.cectech-dark table{
    color:#e5e7eb!important;
}

body.cectech-dark .table td,
body.cectech-dark .table th{
    border-color:rgba(148,163,184,.15)!important;
}

body.cectech-dark .table tbody tr{
    background:rgba(15,23,42,.55)!important;
}

body.cectech-dark .table tbody tr:hover{
    background:rgba(124,58,237,.18)!important;
}

body.cectech-dark input,
body.cectech-dark select,
body.cectech-dark textarea,
body.cectech-dark .form-control,
body.cectech-dark .form-select{
    background:rgba(2,6,23,.76)!important;
    color:#e5e7eb!important;
    border-color:rgba(148,163,184,.22)!important;
}

body.cectech-dark .text-muted{
    color:#94a3b8!important;
}

body.cectech-dark .alert-warning{
    background:rgba(245,158,11,.13)!important;
    color:#fde68a!important;
    border-color:rgba(245,158,11,.25)!important;
}

/* Mobile optimization */
@media(max-width:768px){
    body{
        overflow-x:hidden!important;
    }

    .cec-theme-wrap{
        top:82px;
        right:12px;
    }

    .cec-theme-pill{
        height:34px;
        padding:0 10px;
        font-size:12px;
    }

    .sidebar{
        width:54px!important;
        min-width:54px!important;
    }

    .sidebar-header h3,
    .sidebar-menu span{
        display:none!important;
    }

    .main-content,
    .content,
    .page-content,
    .content-wrapper{
        margin-left:54px!important;
        width:calc(100% - 54px)!important;
        padding:12px!important;
    }

    .cec-noc-hero{
        margin-top:48px!important;
        padding:18px!important;
        border-radius:18px!important;
    }

    .cec-noc-title{
        font-size:20px!important;
        line-height:1.15!important;
    }

    .cec-noc-sub{
        font-size:12px!important;
    }

    .cec-noc-grid{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:10px!important;
    }

    .cec-kpi{
        padding:13px!important;
        border-radius:16px!important;
    }

    .cec-kpi-icon{
        width:34px!important;
        height:34px!important;
        border-radius:12px!important;
    }

    .cec-kpi-value{
        font-size:21px!important;
    }

    .cec-kpi-label{
        font-size:11px!important;
    }

    .cec-noc-panels{
        grid-template-columns:1fr!important;
        gap:12px!important;
    }

    .cec-panel{
        padding:15px!important;
        border-radius:17px!important;
    }

    .card{
        border-radius:16px!important;
        margin-bottom:14px!important;
    }

    .row{
        margin-left:-6px!important;
        margin-right:-6px!important;
    }

    .row > *{
        padding-left:6px!important;
        padding-right:6px!important;
    }

    canvas{
        max-width:100%!important;
    }

    .table-responsive{
        border-radius:
cat >/root/cectech-mobile-dark-fix.sh <<'EOF'
#!/bin/bash
set -e

APP="/var/www/gacs"
CSS="$APP/assets/css/style.css"
HEADER="$APP/views/layouts/header.php"
FOOTER="$APP/views/layouts/footer.php"
BACKUP="/var/www/gacs_mobile_dark_fix_$(date +%F-%H%M)"

cp -a "$APP" "$BACKUP"

# Remove previously injected bad toggle buttons from header
python3 <<'PY'
from pathlib import Path
p = Path("/var/www/gacs/views/layouts/header.php")
s = p.read_text()
bad = '''
<button class="theme-toggle" id="cectechThemeToggle" type="button" title="Toggle dark theme">
    <i class="bi bi-moon-stars-fill"></i>
</button>
'''
s = s.replace(bad, '')
p.write_text(s)
PY

# Inject clean toggle near topbar/page area if missing
if ! grep -q "cecThemePill" "$HEADER"; then
python3 <<'PY'
from pathlib import Path
p = Path("/var/www/gacs/views/layouts/header.php")
s = p.read_text()
pill = '''
<div class="cec-theme-wrap">
    <button class="cec-theme-pill" id="cecThemePill" type="button" aria-label="Toggle dark mode">
        <i class="bi bi-moon-stars-fill"></i>
        <span>Dark</span>
    </button>
</div>
'''
# place immediately after body if reliable; CSS positions it cleanly inside content area
s = s.replace('<body>', '<body>\n' + pill, 1)
p.write_text(s)
PY
fi

cat >> "$CSS" <<'CSS'

/* ======================================================
   CECTECH MOBILE + DARK MODE FIX
   ====================================================== */

/* Hide old bad floating button if duplicated */
.theme-toggle{
    display:none!important;
}

/* Clean dark toggle */
.cec-theme-wrap{
    position:fixed;
    top:78px;
    right:18px;
    z-index:2500;
}

.cec-theme-pill{
    display:flex;
    align-items:center;
    gap:8px;
    height:38px;
    padding:0 13px;
    border-radius:999px;
    border:1px solid rgba(124,58,237,.25);
    background:linear-gradient(135deg,#7c3aed,#2563eb);
    color:#fff;
    font-size:13px;
    font-weight:700;
    box-shadow:0 12px 28px rgba(37,99,235,.25);
}

.cec-theme-pill:active{
    transform:scale(.97);
}

/* Dark mode */
body.cectech-dark{
    background:
        radial-gradient(circle at top left,rgba(124,58,237,.20),transparent 35%),
        radial-gradient(circle at bottom right,rgba(56,189,248,.12),transparent 35%),
        #020617!important;
    color:#e5e7eb!important;
}

body.cectech-dark .main-content,
body.cectech-dark .content,
body.cectech-dark .page-content,
body.cectech-dark .content-wrapper{
    background:transparent!important;
    color:#e5e7eb!important;
}

body.cectech-dark .topbar,
body.cectech-dark .navbar,
body.cectech-dark header{
    background:rgba(15,23,42,.92)!important;
    color:#e5e7eb!important;
    border-color:rgba(148,163,184,.14)!important;
}

body.cectech-dark .card,
body.cectech-dark .cec-kpi,
body.cectech-dark .cec-panel,
body.cectech-dark .modal-content,
body.cectech-dark .dropdown-menu{
    background:rgba(15,23,42,.92)!important;
    color:#e5e7eb!important;
    border:1px solid rgba(148,163,184,.16)!important;
}

body.cectech-dark .card-header,
body.cectech-dark .card-footer,
body.cectech-dark .modal-header,
body.cectech-dark .modal-footer{
    background:rgba(2,6,23,.45)!important;
    color:#f8fafc!important;
    border-color:rgba(148,163,184,.14)!important;
}

body.cectech-dark .table,
body.cectech-dark table{
    color:#e5e7eb!important;
}

body.cectech-dark .table td,
body.cectech-dark .table th{
    border-color:rgba(148,163,184,.15)!important;
}

body.cectech-dark .table tbody tr{
    background:rgba(15,23,42,.55)!important;
}

body.cectech-dark .table tbody tr:hover{
    background:rgba(124,58,237,.18)!important;
}

body.cectech-dark input,
body.cectech-dark select,
body.cectech-dark textarea,
body.cectech-dark .form-control,
body.cectech-dark .form-select{
    background:rgba(2,6,23,.76)!important;
    color:#e5e7eb!important;
    border-color:rgba(148,163,184,.22)!important;
}

body.cectech-dark .text-muted{
    color:#94a3b8!important;
}

body.cectech-dark .alert-warning{
    background:rgba(245,158,11,.13)!important;
    color:#fde68a!important;
    border-color:rgba(245,158,11,.25)!important;
}

/* Mobile optimization */
@media(max-width:768px){
    body{
        overflow-x:hidden!important;
    }

    .cec-theme-wrap{
        top:82px;
        right:12px;
    }

    .cec-theme-pill{
        height:34px;
        padding:0 10px;
        font-size:12px;
    }

    .sidebar{
        width:54px!important;
        min-width:54px!important;
    }

    .sidebar-header h3,
    .sidebar-menu span{
        display:none!important;
    }

    .main-content,
    .content,
    .page-content,
    .content-wrapper{
        margin-left:54px!important;
        width:calc(100% - 54px)!important;
        padding:12px!important;
    }

    .cec-noc-hero{
        margin-top:48px!important;
        padding:18px!important;
        border-radius:18px!important;
    }

    .cec-noc-title{
        font-size:20px!important;
        line-height:1.15!important;
    }

    .cec-noc-sub{
        font-size:12px!important;
    }

    .cec-noc-grid{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:10px!important;
    }

    .cec-kpi{
        padding:13px!important;
        border-radius:16px!important;
    }

    .cec-kpi-icon{
        width:34px!important;
        height:34px!important;
        border-radius:12px!important;
    }

    .cec-kpi-value{
        font-size:21px!important;
    }

    .cec-kpi-label{
        font-size:11px!important;
    }

    .cec-noc-panels{
        grid-template-columns:1fr!important;
        gap:12px!important;
    }

    .cec-panel{
        padding:15px!important;
        border-radius:17px!important;
    }

    .card{
        border-radius:16px!important;
        margin-bottom:14px!important;
    }

    .row{
        margin-left:-6px!important;
        margin-right:-6px!important;
    }

    .row > *{
        padding-left:6px!important;
        padding-right:6px!important;
    }

    canvas{
        max-width:100%!important;
    }

    .table-responsive{
        border-radius:14px!important;
        overflow:auto!important;
    }

    footer,
    .footer{
        padding-bottom:34px!important;
    }
}

@media(max-width:420px){
    .cec-noc-grid{
        grid-template-columns:1fr!important;
    }

    .cec-theme-pill span{
        display:none!important;
    }

    .cec-theme-pill{
        width:36px;
        justify-content:center;
        padding:0!important;
    }
}


/* Remove old dashboard KPI row and keep CECTECH NOC cards */
body.cectech-noc-ready .cec-noc-hero ~ .row:first-of-type,
body.cectech-noc-ready .cec-noc-hero ~ .row:nth-of-type(1){
    display:none!important;
}

/* Make new KPI cards feel clickable */
.cec-kpi{
    cursor:pointer;
}
.cec-kpi:hover{
    transform:translateY(-5px)!important;
    box-shadow:0 18px 45px rgba(124,58,237,.22)!important;
}
.cec-kpi[data-link]:after{
    content:"Tap to open";
    position:absolute;
    right:14px;
    bottom:12px;
    font-size:10px;
    color:#94a3b8;
    opacity:.75;
}

@media(max-width:768px){
    body.cectech-noc-ready .cec-noc-hero ~ .row:first-of-type,
    body.cectech-noc-ready .cec-noc-hero ~ .row:nth-of-type(1){
        display:none!important;
    }
}

/* STRONG FIX: hide original GACS dashboard KPI cards */
body.cectech-noc-ready .row:has(.card .bi-router),
body.cectech-noc-ready .row:has(.card .bi-check-circle),
body.cectech-noc-ready .row:has(.card .bi-x-circle),
body.cectech-noc-ready .row:has(.card .bi-clock),
body.cectech-noc-ready .row:has(.card .bi-clock-history){
    display:none!important;
}

/* fallback: hide first direct dashboard row above NOC */
body.cectech-noc-ready .main-content > .row:first-of-type,
body.cectech-noc-ready .content > .row:first-of-type,
body.cectech-noc-ready .page-content > .row:first-of-type{
    display:none!important;
}


/* CECTECH live clock/location/weather */
.cec-live-strip{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-top:14px;
}
.cec-live-chip{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:9px 12px;
    border-radius:999px;
    background:rgba(255,255,255,.12);
    border:1px solid rgba(255,255,255,.16);
    color:#fff;
    font-size:13px;
    backdrop-filter:blur(12px);
}
@media(max-width:768px){
    .cec-live-chip{
        font-size:11px;
        padding:7px 9px;
    }
}

/* Direct CECTECH live widgets */
.cec-direct-live{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin:14px 0 18px;
}
.cec-direct-live .chip{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:10px 13px;
    border-radius:999px;
    background:linear-gradient(135deg,#111827,#312e81);
    color:#fff;
    font-weight:700;
    font-size:13px;
    box-shadow:0 10px 26px rgba(15,23,42,.18);
}
@media(max-width:768px){
    .cec-direct-live .chip{
        font-size:11px;
        padding:8px 10px;
    }
}
