:root {
    --bg: #f5f7fb;
    --bg-secondary: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;

    --text: #0f172a;
    --text-light: #64748b;

    --border: #e5e7eb;

    --green: #22c55e;
    --yellow: #f59e0b;
    --red: #ef4444;

    --search-bg: #f1f5f9;

    --card-grad-1: #ffffff;
    --card-grad-2: #f1f5f9;

    --card-shadow:
        0 12px 24px rgba(15,23,42,.08),
        inset 0 1px 0 rgba(255,255,255,.7);

    --card-border-glass: rgba(15,23,42,.08);
}

body.dark-mode {
    --bg: #0e1015;
    --bg-secondary: #11131a;
    --bg-sidebar: #11131a;
    --bg-card: #14171f;

    --text: #ffffff;
    --text-light: #b3b3b3;

    --border: #222;

    --green: #2ecc71;
    --yellow: #f4a261;
    --red: #e63946;

    --search-bg: #1a1d25;

    --card-grad-1: #1b2130;
    --card-grad-2: #0f1420;

    --card-shadow:
        0 18px 38px rgba(0,0,0,.6),
        inset 0 1px 0 rgba(255,255,255,.05);

    --card-border-glass: rgba(255,255,255,.08);
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    transition: background 0.25s ease, color 0.25s ease;
}


/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    background: var(--bg-sidebar);
    padding: 24px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    border-radius: 16px;
    background: rgb(141 161 172);
    border: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand img {
    width: 130px;
    height: 150px;
    object-fit: contain;

}

.menu-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 6px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.25s ease;
    overflow: hidden;
}

/* ICON */
.menu-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* HOVER */
.menu-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

/* ACTIVE BACKGROUND */
.menu-item.active {
    background: linear-gradient(
        90deg,
        rgba(95, 191, 138, 0.18),
        rgba(95, 191, 138, 0.05)
    );
    color: #5FBF8A;
    font-weight: 600;
}

/* LEFT ACCENT BAR */
.menu-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0px;
    bottom: 0px;
    width: 4px;
    border-radius: 0 6px 6px 0;
    background: #5FBF8A;
}

/* ACTIVE ICON */
.menu-item.active i {
    color: #5FBF8A;
}

/* ACTIVE TEXT */
.menu-item.active span {
    color: #5FBF8A;
}


.alert-badge {
    margin-left: auto;
    background: #dc3545;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 10px;
    color: #fff;
}

/* ===== SIDEBAR FOOTER ===== */
.powered {
    margin-top: 14px;
    text-align: center;
}

.powered small {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 6px;
}

.powered img {
    width: 84px;
    height: 84px;
    object-fit: contain;
    opacity: .85;
}

/* ===== TOPBAR ===== */
.topbar {
    position: fixed;
    left: 260px;
    right: 0;
    height: 70px;
    padding: 0 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

.search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--search-bg);
    padding: 10px 14px;
    border-radius: 10px;
    width: 280px;
}

.search input {
    background: none;
    border: none;
    color: var(--text);
    outline: none;
    width: 100%;
}

.theme-toggle i {
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.theme-toggle:hover i {
    transform: rotate(20deg) scale(1.1);
}

.top-actions {
    display: flex;
    gap: 14px;
}

.icon-btn {
    background: var(--bg-secondary);
    border: none;
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
}

.notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #dc3545;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}







/* ===== GRID ===== */

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(280px,1fr));
    gap: 22px;
}


/* ===== BASE CARD ===== */

/* ===== THEME AWARE 3D CARD ===== */

.card-3d {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;

    padding: 22px;
    border-radius: 18px;

    background:
        linear-gradient(180deg,
            var(--card-grad-1),
            var(--card-grad-2));

    border: 1px solid var(--card-border-glass);

    box-shadow: var(--card-shadow);

    backdrop-filter: blur(6px);

    cursor: pointer;
    overflow: hidden;

    transition: all .35s ease;
    transform-style: preserve-3d;
}


/* ===== HOVER 3D LIFT ===== */

.card-3d:hover {
    transform:
        translateY(-10px)
        scale(1.02);

    box-shadow:
        0 26px 56px rgba(0,0,0,.18),
        0 0 0 1px rgba(96,165,250,.35);
}


body.dark-mode .card-3d:hover {
    box-shadow:
        0 30px 60px rgba(0,0,0,.7),
        0 0 0 1px rgba(96,165,250,.35);
}


/* ===== GRADIENT EDGE GLOW ===== */

.card-3d::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(120deg,
        transparent,
        rgba(255,255,255,.18),
        transparent);
    opacity: 0;
    transition: .4s;
}

.card-3d:hover::before {
    opacity: 1;
}


/* ===== ICON ===== */

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;

    background: linear-gradient(
        135deg,
        rgba(37,99,235,.18),
        rgba(96,165,250,.18)
    );

    color: #3b82f6;

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.6),
        0 6px 14px rgba(37,99,235,.18);
}



body.dark-mode .card-icon {
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.2),
        0 10px 22px rgba(37,99,235,.35);
}

/* ===== BODY ===== */

.card-body h3 {
    margin: 0 0 6px;
    font-size: 18px;
    letter-spacing: .3px;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #9ca3af;
}

.card-meta i {
    margin-right: 5px;
    opacity: .8;
}


/* ===== RIGHT ARROW ===== */

.card-arrow {
    margin-left: auto;
    font-size: 18px;
    opacity: .6;
    transition: .3s;
}

.card-3d:hover .card-arrow {
    transform: translateX(6px);
    opacity: 1;
}


/* ===== STATUS COLOR GLOWS ===== */

.status-healthy:hover {
    box-shadow:
        0 22px 48px rgba(0,0,0,.65),
        0 0 0 1px rgba(34,197,94,.35),
        0 0 24px rgba(34,197,94,.25);
}

.status-warning:hover {
    box-shadow:
        0 22px 48px rgba(0,0,0,.65),
        0 0 0 1px rgba(245,158,11,.35),
        0 0 24px rgba(245,158,11,.25);
}

.status-critical:hover {
    box-shadow:
        0 22px 48px rgba(0,0,0,.65),
        0 0 0 1px rgba(239,68,68,.35),
        0 0 24px rgba(239,68,68,.25);
}


/* ===== MINI ALERT BADGE ===== */

.alert-badge-mini {
    background: #7f1d1d;
    color: #fff;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
}










/* ===== MAIN OFFSET ===== */
.main {
    margin-left: 260px;
    padding: 110px 48px 60px;
    max-width: 1600px;
}


/* ===== SUMMARY CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 18px;
}

.stat-card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,.4);
}

.stat-card.green { border-left: 4px solid var(--green); }
.stat-card.red { border-left: 4px solid var(--red); }
.stat-card.orange { border-left: 4px solid var(--yellow); }

.subtext {
    font-size: 12px;
    color: var(--text-light);
}

/* ===== BOTTOM GRID ===== */
.bottom-grid {
    margin-top: 35px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.chart-card,
.branch-card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 14px;
    border: 1px solid var(--border);
}

/* ===== LEGEND ===== */
.legend {
    display: flex;
    gap: 18px;
    margin-top: 15px;
}

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

.green { background: var(--green); }
.yellow { background: var(--yellow); }
.red { background: var(--red); }

/* ===== BRANCH LIST ===== */
.branch-item {
    background: var(--bg-secondary);
    padding: 18px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.branch-item.healthy { border-left: 4px solid var(--green); }
.branch-item.warning { border-left: 4px solid var(--yellow); }
.branch-item.critical { border-left: 4px solid var(--red); }

.alert-pill {
    background: var(--red);
    padding: 4px 10px;
    border-radius: 10px;
}

/* ===============================
   DASHBOARD ROW LAYOUT (NEW)
================================ */

/* Common spacing between rows */
.dashboard-row {
    margin-top: 35px;
}

/* FIRST ROW: Device chart + Branch status */
.split-row {
    display: grid;
    grid-template-columns: 0.35fr 0.65fr;
    gap: 25px;
    align-items: stretch;
}

/* Ensure both cards stretch equally */
.split-row > * {
    height: 100%;
}

/* SECOND ROW: Full-width section */
.full-row {
    width: 100%;
}


.device-status-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-title {
    width: 100%;
    font-size: 20px;
    margin-bottom: 20px;
}

.chart-wrapper {
    width: 260px;
    height: 260px;
    margin: 10px 0 20px;
}

.status-legend {
    display: flex;
    gap: 30px;
    margin-bottom: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 14px;
}

.legend-item strong {
    color: var(--text);
    font-weight: 600;
}

.total-count {
    font-size: 15px;
    color: var(--text-light);
}

.total-count strong {
    color: var(--text);
}



/* ===== BRANCH STATUS CARD ===== */

.branch-status-card {
    padding: 0;
    overflow: hidden;
}

.branch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid var(--border);
}

.branch-legend {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--text-light);
}

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

.dot.healthy { background: #5FBF8A; }
.dot.warning { background: #F4B860; }
.dot.critical { background: #E2554F; }

/* ===== BRANCH ROW ===== */

.branch-row {
    margin: 20px;
    padding: 22px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid transparent;
}

.branch-row.healthy {
    border-color: rgba(95,191,138,0.4);
}

.branch-row.warning {
    border-color: rgba(244,184,96,0.4);
}

.branch-row.critical {
    border-color: rgba(226,85,79,0.4);
}

/* LEFT CONTENT */

.branch-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.branch-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.healthy { background: #5FBF8A; }
.status-dot.warning { background: #F4B860; }
.status-dot.critical { background: #E2554F; }

.bank-name {
    font-size: 14px;
    color: var(--text-light);
}

/* META ROW */

.branch-meta {
    display: flex;
    gap: 25px;
    font-size: 14px;
    color: var(--text-light);
}

.branch-meta i {
    margin-right: 6px;
}

.fa-wifi.healthy { color: #5FBF8A; }
.fa-wifi.warning { color: #F4B860; }
.fa-wifi.critical { color: #E2554F; }

/* ALERT BADGE */

.alert-count {
    min-width: 44px;
    height: 32px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
}

.alert-count.warning {
    background: rgba(244,184,96,0.15);
    color: #F4B860;
}

.alert-count.critical {
    background: rgba(226,85,79,0.15);
    color: #E2554F;
}



/* ===============================
   DEVICE STATUS – BRANCH
================================ */

.branch-device-section {
    margin-top: 40px;
}

.section-title {
    font-size: 22px;
    margin-bottom: 20px;
}

/* GRID */

.device-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

/* CARD */

.device-card {
    background: var(--bg-card);
    color: var(--text);
    border-radius: 18px;
    padding: 22px;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02),
                0 20px 40px rgba(0,0,0,.6);
}

/* HEADER */

.device-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.device-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.device-icon.online {
    background: rgba(95,191,138,0.15);
    color: #5FBF8A;
}

.device-icon.warning {
    background: rgba(244,184,96,0.15);
    color: #F4B860;
}

.device-icon.critical {
    background: rgba(226,85,79,0.15);
    color: #E2554F;
}

.device-title h4 {
    font-size: 18px;
}

.device-title p {
    font-size: 14px;
    color: var(--text-light);
}

/* STATUS PILL */

.device-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.device-status.online {
    background: rgba(95,191,138,0.15);
    color: #5FBF8A;
}

.device-status.warning {
    background: rgba(244,184,96,0.15);
    color: #F4B860;
}

.device-status.critical {
    background: rgba(226,85,79,0.15);
    color: #E2554F;
}

.device-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* IP */

.device-ip {
    margin-top: 14px;
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-light);
}

/* DIVIDER */

.device-divider {
    margin: 18px 0;
    height: 1px;
    background: rgba(255,255,255,0.06);
}

/* METRICS */

.device-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.device-metrics p {
    font-size: 14px;
    color: var(--text-light);
}

.device-metrics strong {
    font-size: 18px;
}

/* UPDATED */

.device-updated {
    margin-top: 14px;
    font-size: 13px;
    color: #8fa3bf;
}




/* ===============================
   RECENT ALERTS
================================ */

.alerts-section {
    margin-top: 40px;
    background: var(--bg-card);
    color: var(--text);
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
}

.alerts-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.alerts-header h2 {
    font-size: 22px;
}

.alerts-header p {
    margin-top: 6px;
    color: var(--text-light);
}

/* TABLE */

.alerts-table {
    width: 100%;
}

.alerts-row {
    display: grid;
    grid-template-columns: 2fr 1.4fr 1.4fr 4fr 1.2fr 1.6fr 1.6fr;
    padding: 18px 24px;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.alerts-head {
    font-size: 13px;
    color: #8fa3bf;
    background: rgba(255,255,255,0.02);
    border-top: none;
}

.device-cell span {
    display: block;
    font-size: 14px;
    color: var(--text-light);
}

.muted {
    color: #8fa3bf;
}

/* SEVERITY */

.severity {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    width: fit-content;
}

.severity.critical {
    background: rgba(226,85,79,0.15);
    color: #E2554F;
}

.severity.high,
.severity.medium {
    background: rgba(244,184,96,0.15);
    color: #F4B860;
}

.severity.low {
    background: rgba(143,163,191,0.15);
    color: #8fa3bf;
}

/* STATUS */

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    width: fit-content;
}

.status.pending {
    background: rgba(244,184,96,0.15);
    color: #F4B860;
}

.status.acknowledged {
    background: rgba(95,191,138,0.15);
    color: #5FBF8A;
}

/* ACTION */

.ack-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 14px;
    cursor: pointer;
}

.ack-btn:hover {
    background: rgba(255,255,255,0.06);
}


