* {
    box-sizing: border-box;
}

:root {
    --sidebar: #18242e;
    --sidebar2: #111a21;
    --blue: #2496d2;
    --blue-dark: #1683bd;
    --green: #12a66a;
    --orange: #e89416;
    --red: #dc4b45;
    --purple: #7357c7;
    --bg: #eef2f5;
    --border: #dce2e7;
    --text: #27333d;
    --muted: #7b8791;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.app {
    min-height: 100vh;
    display: flex;
}

/* SIDEBAR */

.sidebar {
    width: 235px;
    min-height: 100vh;
    background: var(--sidebar);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 10;
}

.brand {
    height: 72px;
    background: #101a22;
    display: flex;
    align-items: center;
    padding: 0 18px;
    border-bottom: 1px solid #293640;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 7px;
    background: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    font-weight: bold;
    margin-right: 10px;
}

.brand-title {
    font-size: 17px;
    font-weight: bold;
}

.brand-subtitle {
    color: #8fa2af;
    font-size: 9px;
    letter-spacing: 1.5px;
    margin-top: 3px;
}

.router-mini {
    margin: 15px 12px;
    padding: 13px;
    background: #22313c;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.router-logo {
    font-size: 23px;
}

.router-mini strong {
    display: block;
    font-size: 13px;
}

.router-mini span {
    display: block;
    color: #91a1ab;
    font-size: 10px;
    margin-top: 4px;
}

nav {
    padding-top: 5px;
}

.nav-section {
    padding: 18px 18px 8px;
    color: #70818c;
    font-size: 9px;
    letter-spacing: 1.2px;
    font-weight: bold;
}

.nav-item {
    height: 42px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #b8c4cb;
    text-decoration: none;
    padding: 0 18px;
    font-size: 12px;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #21313d;
    color: white;
}

.nav-item.active {
    background: #213c4b;
    color: white;
    border-left-color: var(--blue);
}

.nav-item span:first-child {
    width: 18px;
    text-align: center;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.green {
    background: #19bd78;
    box-shadow: 0 0 7px rgba(25,189,120,.5);
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 16px;
    border-top: 1px solid #293640;
    font-size: 10px;
    color: #91a1ab;
    display: flex;
    gap: 8px;
    align-items: center;
}

.live-dot {
    width: 7px;
    height: 7px;
    background: #19bd78;
    border-radius: 50%;
}

/* MAIN */

.main {
    margin-left: 235px;
    width: calc(100% - 235px);
}

.topbar {
    height: 72px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.page-title {
    font-size: 21px;
    font-weight: bold;
}

.breadcrumb {
    font-size: 10px;
    color: var(--muted);
    margin-top: 5px;
}

.top-right {
    display: flex;
    align-items: center;
    gap: 22px;
}

.last-update {
    font-size: 10px;
    color: var(--muted);
}

.last-update strong {
    display: block;
    color: var(--text);
    font-size: 11px;
    margin-top: 4px;
}

.router-status {
    padding: 8px 12px;
    border: 1px solid #dbe9e2;
    background: #f3fbf7;
    color: #18845a;
    font-size: 10px;
    border-radius: 5px;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 6px;
}

/* CONTENT */

.content {
    padding: 25px 28px 30px;
    max-width: 1600px;
    margin: auto;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.card {
    min-height: 145px;
    color: white;
    border-radius: 5px;
    padding: 18px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
}

.card.blue {
    background: #2396cf;
}

.card.green-card {
    background: #0a9d68;
}

.card.orange {
    background: #e79212;
}

.card.purple {
    background: #7156c5;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    opacity: .95;
}

.card-icon {
    font-size: 21px;
    opacity: .85;
}

.big-value {
    font-size: 27px;
    font-weight: bold;
    margin-top: 18px;
}

.big-value small {
    font-size: 13px;
}

.card-bottom {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 15px;
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    opacity: .9;
}

.card-bottom strong {
    font-size: 10px;
}

/* SECTION */

.section {
    margin-top: 25px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 13px;
}

.section-title h2 {
    margin: 0;
    font-size: 17px;
}

.section-title p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.refresh-badge {
    background: #effaf5;
    color: #149464;
    border: 1px solid #cceee0;
    border-radius: 4px;
    padding: 7px 11px;
    font-size: 9px;
    font-weight: bold;
}

/* WAN */

.wan-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.wan-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 19px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.wan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wan-name {
    display: flex;
    align-items: center;
    gap: 11px;
}

.wan-icon {
    width: 39px;
    height: 39px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.excitel-icon {
    background: #2396cf;
}

.ani-icon {
    background: #e79212;
}

.wan-name h3 {
    margin: 0;
    font-size: 15px;
}

.wan-name span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}

.online-badge {
    color: #15905e;
    background: #effaf5;
    border: 1px solid #cdebdc;
    border-radius: 20px;
    padding: 6px 9px;
    font-size: 9px;
    font-weight: bold;
}

.online-badge span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #15ad6a;
    border-radius: 50%;
    margin-right: 5px;
}

.wan-role {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    margin: 17px 0;
    border-radius: 5px;
}

.primary-role {
    background: #edf8fd;
    color: #1877a5;
}

.secondary-role {
    background: #fff7e9;
    color: #a96b09;
}

.role-icon {
    font-size: 17px;
}

.wan-role strong {
    display: block;
    font-size: 10px;
}

.wan-role small {
    display: block;
    font-size: 9px;
    opacity: .8;
    margin-top: 3px;
}

.wan-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 3px 3px 17px;
}

.wan-info label {
    display: block;
    font-size: 9px;
    color: var(--muted);
    margin-bottom: 5px;
}

.wan-info strong {
    font-size: 11px;
}

.failover-line {
    border-top: 1px solid #e9edf0;
    padding-top: 14px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.green-line {
    width: 7px;
    height: 31px;
    background: #17ad6d;
    border-radius: 5px;
}

.failover-line strong {
    display: block;
    font-size: 10px;
}

.failover-line small {
    display: block;
    color: var(--muted);
    font-size: 8px;
    margin-top: 3px;
}

.failover-ok {
    margin-left: auto;
    color: #15905e;
    font-size: 8px;
    font-weight: bold;
    background: #effaf5;
    padding: 5px 8px;
    border-radius: 4px;
}

/* PCC */

.pcc-panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 22px;
    display: grid;
    grid-template-columns: 180px 1fr 1fr;
    gap: 30px;
    align-items: center;
}

.pcc-chart-area {
    display: flex;
    justify-content: center;
}

.donut {
    width: 135px;
    height: 135px;
    border-radius: 50%;
    background: conic-gradient(
        #2396cf 0% 70%,
        #e79212 70% 100%
    );
    position: relative;
}

.donut:after {
    content: "";
    position: absolute;
    inset: 26px;
    background: white;
    border-radius: 50%;
}

.donut-center {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.donut-center strong {
    font-size: 21px;
}

.donut-center span {
    color: var(--muted);
    font-size: 8px;
    margin-top: 3px;
}

.pcc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 7px;
}

.pcc-label {
    display: flex;
    align-items: center;
    gap: 9px;
}

.legend {
    width: 9px;
    height: 9px;
    border-radius: 2px;
}

.excitel-legend {
    background: #2396cf;
}

.ani-legend {
    background: #e79212;
}

.pcc-label strong {
    display: block;
    font-size: 11px;
}

.pcc-label small {
    display: block;
    color: var(--muted);
    font-size: 8px;
    margin-top: 3px;
}

.pcc-row > strong {
    font-size: 15px;
}

.progress {
    height: 7px;
    background: #edf0f2;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 18px;
}

.progress div {
    height: 100%;
    width: 70%;
    border-radius: 10px;
}

#excitel-progress {
    background: #2396cf;
}

#ani-progress {
    background: #e79212;
}

.stat {
    padding: 12px 0;
    border-bottom: 1px solid #edf0f2;
}

.stat:last-child {
    border-bottom: 0;
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 9px;
    margin-bottom: 5px;
}

.stat strong {
    font-size: 14px;
}

/* HEALTH */

.health-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.health-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 15px;
    min-height: 88px;
}

.health-card {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 10px;
    align-items: center;
}

.health-icon {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    background: #eef5f8;
    color: #3c6576;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 9px;
    font-weight: bold;
}

.health-card span {
    display: block;
    color: var(--muted);
    font-size: 9px;
}

.health-card strong {
    display: block;
    margin-top: 5px;
    font-size: 13px;
}

.health-bar {
    grid-column: 1 / -1;
    height: 5px;
    background: #edf0f2;
    border-radius: 5px;
    overflow: hidden;
}

.health-bar div {
    width: 0%;
    height: 100%;
    background: #2496d2;
    transition: width .5s ease;
}

.api-online {
    color: #15905e;
}

/* FOOTER */

footer {
    margin-top: 30px;
    padding: 18px 5px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: #89959d;
    font-size: 9px;
}

footer span {
    margin: 0 5px;
}

footer strong {
    color: #53616b;
}

/* RESPONSIVE */

@media(max-width: 1100px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .health-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pcc-panel {
        grid-template-columns: 160px 1fr;
    }

    .pcc-stats {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
}

@media(max-width: 750px) {
    .sidebar {
        width: 65px;
    }

    .brand-title,
    .brand-subtitle,
    .router-mini div:not(.router-logo),
    .nav-item:not(.active),
    .nav-section,
    .sidebar-footer span {
        display: none;
    }

    .brand {
        justify-content: center;
        padding: 0;
    }

    .router-mini {
        justify-content: center;
    }

    .main {
        margin-left: 65px;
        width: calc(100% - 65px);
    }

    .cards,
    .wan-grid,
    .health-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 0 15px;
    }

    .last-update {
        display: none;
    }

    .content {
        padding: 15px;
    }

    .pcc-panel {
        grid-template-columns: 1fr;
    }

    .pcc-stats {
        grid-template-columns: 1fr 1fr;
    }
}

/* =========================================================
   ADVANCED MONITORING
   ========================================================= */

.advanced-section {
    margin-top: 10px;
}

.monitor-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 20px;
}

.monitor-card {
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,.04);
}

.monitor-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #687386;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
}

.monitor-icon {
    font-size: 12px;
    font-weight: 800;
    opacity: .7;
}

.active-wan-name {
    font-size: 25px;
    font-weight: 800;
    margin: 15px 0 10px;
}

.monitor-big-value {
    font-size: 30px;
    font-weight: 800;
    margin: 15px 0 5px;
}

.monitor-muted {
    color: #8993a3;
    font-size: 12px;
}

.monitor-detail {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #edf0f4;
    padding-top: 9px;
    margin-top: 9px;
    color: #7b8492;
    font-size: 12px;
}

.monitor-detail strong {
    color: #252b35;
}

.mini-progress {
    height: 6px;
    background: #edf1f5;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 12px;
}

.mini-progress div {
    height: 100%;
    width: 0;
    border-radius: inherit;
    transition: width .4s ease;
    background: #2396cf;
}

.performance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 20px;
}

.performance-card {
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 6px 20px rgba(0,0,0,.04);
}

.performance-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.performance-head strong {
    display: block;
    font-size: 18px;
}

.performance-head small {
    color: #8a93a1;
    font-size: 11px;
}

.health-dot {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 50%;
    background: #32b768;
    box-shadow: 0 0 0 4px rgba(50,183,104,.12);
}

.health-dot.offline {
    background: #dc4b45;
    box-shadow: 0 0 0 4px rgba(220,75,69,.12);
}

.speed-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 22px 0;
}

.speed-grid > div,
.traffic-total > div {
    background: #f7f9fb;
    border-radius: 12px;
    padding: 14px;
}

.speed-grid span,
.traffic-total span,
.error-grid span {
    display: block;
    color: #8993a3;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
}

.speed-grid strong {
    display: block;
    font-size: 22px;
    margin-top: 5px;
}

.traffic-total {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.traffic-total strong {
    display: block;
    margin-top: 4px;
    font-size: 14px;
}

.error-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.error-grid > div {
    padding: 9px;
    border: 1px solid #edf0f4;
    border-radius: 9px;
}

.error-grid strong {
    display: block;
    margin-top: 3px;
    font-size: 12px;
}

.route-panel,
.interface-panel {
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,.04);
}

.route-panel-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
}

.route-panel-head h3 {
    margin: 0;
    font-size: 17px;
}

.route-panel-head p {
    margin: 4px 0 0;
    color: #8993a3;
    font-size: 12px;
}

.route-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.route-card {
    border: 1px solid #edf0f4;
    border-radius: 12px;
    padding: 16px;
}

.route-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.route-title strong,
.route-title small {
    display: block;
}

.route-title small {
    color: #8993a3;
    margin-top: 3px;
    font-size: 11px;
}

.route-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.excitel-route {
    background: #e9f6fc;
    color: #2396cf;
}

.ani-route {
    background: #fff3df;
    color: #d68108;
}

.route-row,
.service-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px solid #edf0f4;
    font-size: 12px;
}

.route-row span,
.service-row span {
    color: #8993a3;
}

.interface-table-wrap {
    overflow-x: auto;
}

.interface-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.interface-table th {
    text-align: left;
    color: #8993a3;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 11px 10px;
    background: #f7f9fb;
    white-space: nowrap;
}

.interface-table td {
    padding: 12px 10px;
    border-top: 1px solid #edf0f4;
    white-space: nowrap;
}

.interface-status {
    font-weight: 800;
}

.interface-status.online {
    color: #25a35a;
}

.interface-status.offline {
    color: #dc4b45;
}

.service-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.service-card {
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,.04);
}

.service-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.service-head span {
    color: #25a35a;
    font-size: 11px;
    font-weight: 800;
}

@media (max-width: 1100px) {

    .monitor-grid {
        grid-template-columns: 1fr 1fr;
    }

    .performance-grid,
    .route-grid,
    .service-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {

    .monitor-grid {
        grid-template-columns: 1fr;
    }

    .speed-grid,
    .traffic-total {
        grid-template-columns: 1fr;
    }

    .error-grid {
        grid-template-columns: 1fr 1fr;
    }
}


/* PCC CLIENT WAN MAP FIX */

#pcc-client-map .card {
    background: #ffffff;
    color: #1f2937;
    overflow-x: auto;
}

#pcc-client-map table {
    width: 100%;
    border-collapse: collapse;
    color: #1f2937;
    font-size: 14px;
}

#pcc-client-map th {
    background: #1f2937;
    color: #ffffff;
    padding: 12px;
    text-align: left;
}

#pcc-client-map td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    color: #111827;
    white-space: nowrap;
}

#pcc-client-map tr:hover {
    background: #f3f4f6;
}

#pcc-client-map td:nth-child(3) {
    font-weight: bold;
}

#pcc-client-map td:nth-child(3):contains("Excitel") {
    color: #2563eb;
}

#pcc-client-map td:nth-child(3):contains("ANI") {
    color: #16a34a;
}



/* PCC TABLE FORCE FIX */

section#pcc-client-map {
    color: #111827 !important;
}

section#pcc-client-map .card {
    background: #ffffff !important;
    color: #111827 !important;
    width: 100% !important;
    overflow-x: auto !important;
}

section#pcc-client-map table {
    width: 100% !important;
    border-collapse: collapse !important;
    color: #111827 !important;
    background: #ffffff !important;
}

section#pcc-client-map table th {
    background: #374151 !important;
    color: #ffffff !important;
    padding: 12px !important;
    font-weight: 700 !important;
}

section#pcc-client-map table td {
    color: #111827 !important;
    background: #ffffff !important;
    padding: 10px 12px !important;
    border-bottom: 1px solid #d1d5db !important;
    font-weight: 500 !important;
}

section#pcc-client-map table tr:hover td {
    background: #f3f4f6 !important;
}

section#pcc-client-map table th:nth-child(1),
section#pcc-client-map table td:nth-child(1) {
    width: 25% !important;
}

section#pcc-client-map table th:nth-child(2),
section#pcc-client-map table td:nth-child(2) {
    width: 20% !important;
}

section#pcc-client-map table th:nth-child(3),
section#pcc-client-map table td:nth-child(3) {
    width: 15% !important;
    font-weight:700 !important;
}

section#pcc-client-map table th:nth-child(4),
section#pcc-client-map table td:nth-child(4),
section#pcc-client-map table th:nth-child(5),
section#pcc-client-map table td:nth-child(5) {
    width:20% !important;
}


/* PCC WAN BADGES */

.wan-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.wan-badge.ani {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

.wan-badge.excitel {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.wan-badge.both {
  background:#fef3c7;
  color:#92400e;
  border:1px solid #fcd34d;
}

.wan-badge.idle {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
}



/* =========================================================
   FINAL LIVE WAN BANDWIDTH
   ========================================================= */

/* =========================================================
   FINAL LIVE WAN - VISUAL POLISH
   ========================================================= */

.final-wan-metrics {
    min-height: 62px;
}

.final-metric {
    display: flex;
    align-items: center;
    gap: 14px;
}

.final-metric-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.final-metric-icon svg,
.final-total-stat-icon svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.excitel-download-icon {
    background: #eaf2ff;
    color: #2563eb;
}

.excitel-upload-icon {
    background: #eaf8ef;
    color: #16a34a;
}

.ani-download-icon {
    background: #fff0df;
    color: #ea580c;
}

.ani-upload-icon {
    background: #fdebec;
    color: #dc2626;
}

.final-metric-text {
    min-width: 0;
}

.final-metric-text span {
    margin-bottom: 4px;
}

.final-metric-text strong {
    white-space: nowrap;
}

.final-total-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.final-total-stat-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.peak-icon {
    color: #6d28d9;
}

.average-icon {
    color: #6d28d9;
}

.live-range {
    position: relative;
    padding-right: 30px;
}

.live-range::after {
    content: "⌄";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-53%);
    color: #64748b;
    font-size: 15px;
    line-height: 1;
}

.final-total-card {
    padding-left: 22px;
    padding-right: 22px;
}



.live-final-header {
    align-items: flex-start;
}

.live-final-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.live-final-stat {
    min-width: 125px;
    text-align: left;
}

.live-final-stat span {
    display: block;
    margin-bottom: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.live-final-stat strong {
    display: block;
    color: #111827;
    font-size: 24px;
    line-height: 1.1;
}

.live-final-stat.peak strong {
    color: #ea580c;
}

.live-final-divider {
    width: 1px;
    height: 42px;
    background: #cbd5e1;
}

.live-range {
    padding: 9px 13px;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    color: #334155;
    background: #ffffff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.live-bandwidth-panel.final-live-panel {
    padding: 20px 18px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.06);
}

.live-bandwidth-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin: 0 6px 14px;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
}

.live-bandwidth-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.excitel-download {
    background: #2563eb;
}

.legend-dot.excitel-upload {
    background: #16a34a;
}

.legend-dot.ani-download {
    background: #f97316;
}

.legend-dot.ani-upload {
    background: #dc2626;
}

.live-bandwidth-chart-wrap.final-chart-wrap {
    position: relative;
    width: 100%;
    height: 390px;
    background: #fbfdff;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    overflow: hidden;
}

#live-bandwidth-chart {
    display: block;
    width: 100%;
    height: 100%;
}

.live-bandwidth-cards.final-live-cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1.05fr;
    gap: 16px;
    margin-top: 18px;
}

.live-wan-card.final-wan-card {
    min-height: 190px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.025);
}

.final-wan-card h3 {
    margin: 0 0 20px;
    color: #111827;
    font-size: 17px;
    font-weight: 700;
}

.final-wan-card h3 strong {
    font-weight: 700;
}

.final-wan-card h3 span {
    margin-left: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.excitel-card h3 strong {
    color: #2563eb;
}

.ani-card h3 strong {
    color: #ea580c;
}

.final-wan-metrics {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
}

.final-wan-metrics span,
.final-wan-total span,
.final-total-card > span {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 11px;
    font-weight: 500;
}

.final-wan-metrics strong {
    display: block;
    color: #111827;
    font-size: 16px;
}

.metric-divider {
    width: 1px;
    height: 42px;
    background: #e2e8f0;
}

.final-wan-total {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed #e2e8f0;
    text-align: center;
}

.final-wan-total strong {
    color: #2563eb;
    font-size: 19px;
}

.ani-card .final-wan-total strong {
    color: #ea580c;
}

.final-total-card {
    min-height: 190px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.final-total-card h3 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 17px;
}

.final-total-value {
    display: block;
    margin-bottom: 5px;
    color: #6d28d9;
    font-size: 29px;
    line-height: 1.1;
}

.final-total-card > span {
    margin-bottom: 17px;
}

.final-total-stats {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    padding-top: 13px;
    border-top: 1px dashed #e2e8f0;
}

.final-total-stats span {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 10px;
}

.final-total-stats strong {
    color: #6d28d9;
    font-size: 14px;
}

.live-final-info {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 18px;
    padding: 13px 16px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #f8fbff;
    color: #64748b;
    font-size: 12px;
}

.live-final-info b {
    color: #94a3b8;
    font-weight: 500;
}

.live-info-icon {
    color: #2563eb;
    font-size: 10px;
}

@media (max-width: 1100px) {
    .live-final-header-right {
        gap: 12px;
    }

    .live-final-stat {
        min-width: 100px;
    }

    .live-final-stat strong {
        font-size: 20px;
    }

    .live-bandwidth-cards.final-live-cards {
        grid-template-columns: 1fr 1fr;
    }

    .final-total-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 800px) {
    .live-final-header {
        flex-direction: column;
        gap: 14px;
    }

    .live-final-header-right {
        width: 100%;
        flex-wrap: wrap;
    }

    .live-bandwidth-chart-wrap.final-chart-wrap {
        height: 330px;
    }

    .live-bandwidth-cards.final-live-cards {
        grid-template-columns: 1fr;
    }

    .final-total-card {
        grid-column: auto;
    }
}

@media (max-width: 600px) {
    .live-final-header-right {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .live-final-divider {
        display: none;
    }

    .live-range {
        grid-column: 1 / -1;
        width: fit-content;
    }

    .live-bandwidth-chart-wrap.final-chart-wrap {
        height: 280px;
    }

    .live-bandwidth-legend {
        gap: 10px;
    }

    .live-final-info {
        flex-wrap: wrap;
    }
}
