/* ============================================================
   Minimal Modern Stylesheet — v2
   Purple is reserved. Whitespace does the work.
   ============================================================ */

   :root {
    /* Brand */
    --primary:          #300040;
    --primary-hover:    #4a006a;
    --primary-subtle:   rgba(48, 0, 64, 0.08);
    --primary-ghost:    rgba(48, 0, 64, 0.06);

    /* Ink */
    --ink:              #0f0a14;
    --ink-2:            #6e6878;
    --ink-3:            #b0a8ba;

    /* Surfaces */
    --surface:          #ffffff;
    --bg:               #faf9fb;

    /* Borders */
    --line:             rgba(0, 0, 0, 0.07);
    --line-strong:      rgba(0, 0, 0, 0.12);

    /* Semantic */
    --danger:           #dc2626;
    --danger-bg:        #fef2f2;
    --danger-text:      #b91c1c;
    --warn:             #d97706;
    --warn-bg:          #fffbeb;
    --warn-text:        #92400e;
    --good:             #16a34a;
    --good-bg:          #f0fdf4;
    --good-text:        #15803d;

    /* Shape */
    --r-sm:             8px;
    --r-md:             12px;
    --r-lg:             16px;
    --r-xl:             20px;
}

/* Dark mode */
body.dark-mode {
    --primary:          #c084e0;
    --primary-hover:    #d4a8e8;
    --primary-subtle:   rgba(192, 132, 224, 0.12);
    --primary-ghost:    rgba(192, 132, 224, 0.07);

    --ink:              #ede9f2;
    --ink-2:            #8a8099;
    --ink-3:            #5a5268;

    --surface:          #1a1520;
    --bg:               #120f18;

    --line:             rgba(255, 255, 255, 0.07);
    --line-strong:      rgba(255, 255, 255, 0.12);

    --danger-bg:        rgba(220, 38, 38, 0.12);
    --danger-text:      #fca5a5;
    --warn-bg:          rgba(217, 119, 6, 0.12);
    --warn-text:        #fcd34d;
    --good-bg:          rgba(22, 163, 74, 0.12);
    --good-text:        #86efac;
}


/* ============================================================
   Reset & base
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-size: 13px;
    line-height: 1.55;
    background-color: var(--bg);
    color: var(--ink);
    transition: background-color 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--primary-hover);
}

button {
    font-family: inherit;
    cursor: pointer;
}


/* ============================================================
   Header
   ============================================================ */

.header {
    background-color: var(--primary);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

/* Brand / logo group */
.header .logos {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header .logos img {
    max-height: 28px;
    width: auto;
}

/* Icon-mark fallback when no logo image */
.header .logo-mark {
    width: 30px;
    height: 30px;
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    flex-shrink: 0;
}

.header .wallet {
    display: flex;
    flex-direction: column;
}

.header .wallet h1 {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.header .wallet h2 {
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 1px;
}

/* Header action area */
.header .header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Ghost icon button */
.header .btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: background 0.15s;
}

.header .btn-icon:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* Pill button (e.g. alert count) */
.header .btn-pill {
    height: 28px;
    padding: 0 12px;
    border-radius: 14px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s;
}

.header .btn-pill:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Alert dot inside pill */
.header .alert-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #f87171;
    flex-shrink: 0;
}

/* Dark mode toggle */
.switch {
    position: relative;
    width: 36px;
    height: 20px;
    display: inline-block;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.slider {
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: background 0.2s;
}

.slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 2px;
    left: 2px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.2s;
}

.switch input:checked + .slider {
    background: rgba(255, 255, 255, 0.35);
}

.switch input:checked + .slider::before {
    transform: translateX(16px);
}


/* ============================================================
   Navbar
   ============================================================ */

.navbar {
    background-color: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s;
}

.navbar ul {
    list-style: none;
    display: flex;
    padding: 0 12px;
}

.navbar > ul > li {
    position: relative;
}

/* Top-level links */
.navbar > ul > li > a {
    height: 42px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 10px;
    font-size: 12px;
    color: var(--ink-2);
    text-decoration: none;
    border-bottom: 1.5px solid transparent;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.navbar > ul > li > a:hover {
    color: var(--ink);
    text-decoration: none;
}

.navbar > ul > li.active > a,
.navbar > ul > li > a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
}

.dark-mode .navbar > ul > li.active > a,
.dark-mode .navbar > ul > li > a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Nav icons */
.navbar > ul > li > a i {
    font-size: 14px;
}

/* First-level dropdown */
.navbar > ul > li > ul {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    min-width: 200px;
    z-index: 200;
    padding: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.navbar > ul > li:hover > ul {
    display: block;
}

.navbar ul ul li {
    position: relative;
}

.navbar ul ul li a {
    display: block;
    padding: 7px 10px;
    border-radius: var(--r-sm);
    font-size: 12px;
    color: var(--ink);
    text-decoration: none;
    transition: background 0.12s;
}

.navbar ul ul li a:hover {
    background: var(--bg);
    color: var(--primary);
    text-decoration: none;
}

/* Nested submenu */
.navbar ul ul li > ul {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    min-width: 200px;
    z-index: 200;
    padding: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.navbar ul ul li:hover > ul {
    display: block;
}

.navbar ul ul.adjust-left {
    left: auto !important;
    right: 100% !important;
}


/* ============================================================
   Layout
   ============================================================ */

.main-content {
    padding: 20px;
    margin: 0 auto;
    max-width: 90%;
    width: 90%;
}

/* Two-column layout helper */
.layout-grid {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 0;
}


/* ============================================================
   Cards (replaces .column70 / .column3)
   ============================================================ */

.column70,
.column3 {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    margin-bottom: 14px;
    transition: background-color 0.3s;
}

.column70 a,
.column3 a {
    font-weight: 500;
}

/* Card header */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 0;
}

.card-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
}

.card-meta {
    font-size: 11px;
    color: var(--ink-3);
}

/* Card body */
.card-body {
    padding: 12px 18px 18px;
}


/* ============================================================
   KPI / stat strip
   ============================================================ */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.stat {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    padding: 16px 18px;
}

.stat-label {
    font-size: 11px;
    color: var(--ink-3);
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 26px;
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--ink);
}

.stat-value.danger { color: var(--danger); }
.stat-value.warn   { color: var(--warn); }
.stat-value.good   { color: var(--good); }

.stat-sub {
    font-size: 11px;
    color: var(--ink-3);
    margin-top: 4px;
}


/* ============================================================
   Severity alerts (replaces .high_severity etc.)
   ============================================================ */

.high_severity,
.medium_severity,
.low_severity {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--r-md);
    margin-bottom: 6px;
}

.high_severity:last-child,
.medium_severity:last-child,
.low_severity:last-child {
    margin-bottom: 0;
}

/* Severity icon container */
.severity-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 14px;
}

.high_severity   { background: transparent; }
.medium_severity { background: transparent; }
.low_severity    { background: transparent; }

.high_severity   .severity-icon { background: var(--danger-bg); color: var(--danger); }
.medium_severity .severity-icon { background: var(--warn-bg);   color: var(--warn); }
.low_severity    .severity-icon { background: var(--good-bg);   color: var(--good); }

.severity-body {
    flex: 1;
    min-width: 0;
}

.severity-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 2px;
}

.severity-desc {
    font-size: 11px;
    color: var(--ink-2);
}


/* ============================================================
   Badges
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 500;
    flex-shrink: 0;
}

.badge-danger { background: var(--danger-bg); color: var(--danger-text); }
.badge-warn   { background: var(--warn-bg);   color: var(--warn-text); }
.badge-good   { background: var(--good-bg);   color: var(--good-text); }

/* Live indicator */
.live-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--good);
    display: inline-block;
}


/* ============================================================
   Table
   ============================================================ */

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

thead th {
    padding: 8px 18px;
    text-align: left;
    font-size: 10px;
    font-weight: 500;
    color: var(--ink-3);
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--line);
}

tbody td {
    padding: 10px 18px;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover td {
    background: var(--bg);
}

td.muted { color: var(--ink-2); }
td.pos   { color: var(--good);  font-weight: 500; }
td.neg   { color: var(--danger); font-weight: 500; }

.status {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 6px;
}

.status.done { background: var(--good-bg);   color: var(--good-text); }
.status.pend { background: var(--warn-bg);   color: var(--warn-text); }
.status.fail { background: var(--danger-bg); color: var(--danger-text); }


/* ============================================================
   Progress bar
   ============================================================ */

.progress-bar {
    height: 3px;
    background: var(--line);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--primary);
    transition: width 0.4s ease;
}


/* ============================================================
   Sidebar rows
   ============================================================ */

.side-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--ink-3);
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.side-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
}

.side-row-label {
    font-size: 11px;
    color: var(--ink-2);
    display: flex;
    align-items: center;
    gap: 5px;
}

.side-row-label i {
    font-size: 13px;
    color: var(--ink-3);
}

.side-row-value {
    font-size: 11px;
    font-weight: 500;
    color: var(--ink);
}


/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: var(--r-md);
    font-size: 12px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border: none;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line-strong);
}

.btn-secondary:hover {
    background: var(--bg);
}


/* ============================================================
   Divider
   ============================================================ */

.divider {
    height: 1px;
    background: var(--line);
    border: none;
    margin: 0;
}


/* ============================================================
   Footer
   ============================================================ */

.footer {
    background-color: #300040;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
}

.footer a {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    margin-left: 14px;
    transition: color 0.15s;
}

.footer a:hover {
    color: rgba(255, 255, 255, 0.75);
}


/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
    .header {
        padding: 0 14px;
        height: auto;
        min-height: 56px;
        flex-wrap: wrap;
        gap: 8px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .navbar ul {
        flex-direction: column;
        padding: 0;
    }

    .navbar > ul > li > a {
        height: auto;
        padding: 10px 14px;
        border-bottom: none;
        border-left: 2px solid transparent;
    }

    .navbar > ul > li.active > a,
    .navbar > ul > li > a.active {
        border-left-color: var(--primary);
        border-bottom: none;
    }

    .navbar > ul > li > ul {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding-left: 14px;
    }

    .layout-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 14px;
        max-width: 100%;
        width: 100%;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 14px;
    }
}