/* =========================================================
   AEGISONE - SECURITY PLATFORM
   FULL FINAL STYLE
   ========================================================= */

:root {
    --bg: #07111f;
    --bg-soft: #0b1728;
    --panel: #0d1b2e;
    --panel-2: #101f33;
    --border: rgba(148, 163, 184, 0.14);

    --text: #f1f5f9;
    --muted: #8ea0b8;

    --blue: #38bdf8;
    --blue-dark: #0ea5e9;

    --green: #22c55e;
    --red: #ef4444;
    --orange: #f59e0b;
    --purple: #a78bfa;

    --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);

    --sidebar-width: 255px;
    --topbar-height: 76px;

    --radius: 16px;
}


/* =========================================================
   RESET
   ========================================================= */

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


html {
    scroll-behavior: smooth;
}


body {
    min-height: 100vh;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background:
        radial-gradient(
            circle at 80% 0%,
            rgba(14, 165, 233, 0.08),
            transparent 30%
        ),
        var(--bg);

    color: var(--text);

    line-height: 1.5;
}


button,
input,
select,
textarea {
    font: inherit;
}


button {
    cursor: pointer;
}


a {
    color: inherit;
    text-decoration: none;
}


code {
    font-family:
        "Cascadia Code",
        "Fira Code",
        Consolas,
        monospace;
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}


::-webkit-scrollbar-track {
    background: #06101d;
}


::-webkit-scrollbar-thumb {
    background: #23364d;
    border-radius: 20px;
}


::-webkit-scrollbar-thumb:hover {
    background: #34516e;
}


/* =========================================================
   APPLICATION
   ========================================================= */

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


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;

    width: var(--sidebar-width);

    background:
        linear-gradient(
            180deg,
            #0a1728 0%,
            #07121f 100%
        );

    border-right: 1px solid var(--border);

    display: flex;
    flex-direction: column;

    z-index: 1000;

    transition:
        transform 0.25s ease,
        width 0.25s ease;
}


/* =========================================================
   SIDEBAR BRAND
   ========================================================= */

.sidebar-brand {
    height: var(--topbar-height);

    padding: 0 22px;

    display: flex;
    align-items: center;
    gap: 12px;

    border-bottom: 1px solid var(--border);
}


.brand-mark {
    width: 40px;
    height: 40px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #0ea5e9,
            #2563eb
        );

    box-shadow:
        0 10px 30px rgba(14, 165, 233, 0.22);
}


.brand-mark span {
    font-size: 21px;
    font-weight: 900;
    color: white;
}


.brand-text h1 {
    font-size: 18px;
    line-height: 1.1;
    letter-spacing: -0.4px;
}


.brand-text p {
    margin-top: 3px;

    color: var(--muted);

    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.1px;
}


/* =========================================================
   SIDEBAR NAV
   ========================================================= */

.sidebar-nav {
    padding: 24px 13px;
    flex: 1;
}


.nav-label {
    padding: 0 11px;
    margin-bottom: 9px;

    color: #61748d;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 1.5px;
}


.nav-label-space {
    margin-top: 25px;
}


.nav-item {
    width: 100%;

    border: 0;
    background: transparent;

    color: #8fa2b9;

    min-height: 46px;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 0 12px;

    margin-bottom: 5px;

    border-radius: 11px;

    text-align: left;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}


.nav-item:hover {
    background: rgba(56, 189, 248, 0.07);
    color: #dcecff;

    transform: translateX(2px);
}


.nav-item.active {
    background:
        linear-gradient(
            90deg,
            rgba(14, 165, 233, 0.16),
            rgba(14, 165, 233, 0.05)
        );

    color: #f1faff;

    box-shadow:
        inset 3px 0 0 var(--blue);
}


.nav-icon {
    width: 25px;

    color: #7e94ad;

    font-size: 17px;

    text-align: center;
}


.nav-item.active .nav-icon {
    color: var(--blue);
}


/* =========================================================
   SIDEBAR FOOTER
   ========================================================= */

.sidebar-footer {
    padding: 17px;

    border-top: 1px solid var(--border);
}


.security-indicator {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 11px;

    border-radius: 12px;

    background: rgba(34, 197, 94, 0.06);

    border: 1px solid rgba(34, 197, 94, 0.1);
}


.status-dot {
    width: 8px;
    height: 8px;

    flex: 0 0 auto;

    border-radius: 50%;

    background: var(--green);

    box-shadow:
        0 0 0 4px rgba(34, 197, 94, 0.1),
        0 0 15px rgba(34, 197, 94, 0.7);
}


.status-dot.offline {
    background: var(--red);

    box-shadow:
        0 0 0 4px rgba(239, 68, 68, 0.1),
        0 0 15px rgba(239, 68, 68, 0.5);
}


.security-indicator strong {
    display: block;

    font-size: 12px;
}


.security-indicator small {
    display: block;

    color: var(--muted);

    font-size: 10px;
}


.sidebar-footer > p {
    margin-top: 13px;

    color: #53667d;

    font-size: 10px;

    text-align: center;
}


/* =========================================================
   MAIN AREA
   ========================================================= */

.main-area {
    width: calc(100% - var(--sidebar-width));

    margin-left: var(--sidebar-width);

    min-height: 100vh;

    display: flex;
    flex-direction: column;
}


/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
    position: sticky;
    top: 0;

    height: var(--topbar-height);

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

    padding: 0 30px;

    background:
        rgba(7, 17, 31, 0.86);

    backdrop-filter: blur(16px);

    border-bottom: 1px solid var(--border);

    z-index: 900;
}


.menu-button {
    display: none;

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

    background: var(--panel);

    color: white;

    width: 40px;
    height: 40px;

    border-radius: 10px;
}


.topbar-title span {
    display: block;

    color: var(--blue);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 1.7px;
}


.topbar-title h2 {
    margin-top: 2px;

    font-size: 19px;

    letter-spacing: -0.4px;
}


.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}


.connection-status {
    display: flex;
    align-items: center;
    gap: 9px;

    padding: 8px 12px;

    border: 1px solid rgba(34, 197, 94, 0.15);

    background: rgba(34, 197, 94, 0.05);

    color: #b8f7cc;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 700;
}


.connection-status.offline {
    color: #fecaca;

    background: rgba(239, 68, 68, 0.06);

    border-color: rgba(239, 68, 68, 0.18);
}


.icon-button {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

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

    border-radius: 10px;

    background: var(--panel);

    color: #cbd5e1;

    font-size: 20px;

    transition: 0.2s;
}


.icon-button:hover {
    color: white;

    border-color: rgba(56, 189, 248, 0.35);

    transform: rotate(30deg);
}


/* =========================================================
   CONTENT
   ========================================================= */

.content {
    width: 100%;
    max-width: 1500px;

    margin: 0 auto;

    padding: 32px;
}


/* =========================================================
   PAGE SECTIONS
   ========================================================= */

.page-section {
    display: none;

    animation: sectionIn 0.25s ease;
}


.page-section.active-section {
    display: block;
}


@keyframes sectionIn {
    from {
        opacity: 0;
        transform: translateY(7px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   HERO
   ========================================================= */

.hero-panel {
    position: relative;

    min-height: 340px;

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

    overflow: hidden;

    padding: 45px 50px;

    border: 1px solid rgba(56, 189, 248, 0.14);

    border-radius: 22px;

    background:
        radial-gradient(
            circle at 80% 40%,
            rgba(14, 165, 233, 0.16),
            transparent 32%
        ),
        linear-gradient(
            135deg,
            #0d2037,
            #091728
        );

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


.hero-panel::before {
    content: "";

    position: absolute;

    width: 280px;
    height: 280px;

    right: -100px;
    top: -130px;

    border-radius: 50%;

    border: 1px solid rgba(56, 189, 248, 0.08);
}


.hero-content {
    position: relative;
    z-index: 2;

    max-width: 680px;
}


.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 7px 11px;

    border-radius: 999px;

    background: rgba(34, 197, 94, 0.08);

    border: 1px solid rgba(34, 197, 94, 0.16);

    color: #9ce8b3;

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 1.2px;
}


.hero-badge span {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--green);

    box-shadow: 0 0 10px var(--green);
}


.hero-content h1 {
    margin-top: 20px;

    font-size: clamp(35px, 4vw, 58px);

    line-height: 1.02;

    letter-spacing: -2.5px;
}


.hero-content h1 span {
    display: block;

    color: var(--blue);
}


.hero-content > p {
    max-width: 610px;

    margin-top: 17px;

    color: var(--muted);

    font-size: 14px;
}


/* =========================================================
   HERO BUTTONS
   ========================================================= */

.hero-actions {
    display: flex;
    flex-wrap: wrap;

    gap: 11px;

    margin-top: 27px;
}


.btn {
    min-height: 42px;

    padding: 0 17px;

    border-radius: 10px;

    border: 1px solid transparent;

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

    gap: 8px;

    font-size: 12px;
    font-weight: 800;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.btn:hover {
    transform: translateY(-2px);
}


.btn-primary {
    color: white;

    background:
        linear-gradient(
            135deg,
            #0ea5e9,
            #2563eb
        );

    box-shadow:
        0 10px 25px rgba(14, 165, 233, 0.18);
}


.btn-primary:hover {
    box-shadow:
        0 14px 32px rgba(14, 165, 233, 0.25);
}


.btn-secondary {
    color: #d8e4f0;

    background: rgba(255, 255, 255, 0.025);

    border-color: var(--border);
}


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

    border-color: rgba(148, 163, 184, 0.25);
}


.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}


/* =========================================================
   HERO VISUAL
   ========================================================= */

.hero-visual {
    position: relative;

    width: 300px;
    height: 260px;

    flex: 0 0 300px;

    display: grid;
    place-items: center;
}


.shield-glow {
    position: relative;

    z-index: 3;

    width: 130px;
    height: 130px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(56, 189, 248, 0.2),
            transparent 65%
        );

    animation: shieldPulse 3s infinite ease-in-out;
}


.shield {
    width: 88px;
    height: 100px;

    display: grid;
    place-items: center;

    font-size: 54px;

    filter:
        drop-shadow(
            0 0 22px
            rgba(56, 189, 248, 0.55)
        );
}


.hero-orbit {
    position: absolute;

    border: 1px solid rgba(56, 189, 248, 0.16);

    border-radius: 50%;
}


.orbit-one {
    width: 190px;
    height: 190px;

    transform: rotate(25deg);
}


.orbit-two {
    width: 250px;
    height: 130px;

    transform: rotate(-25deg);
}


@keyframes shieldPulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }
}


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

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 16px;

    margin-top: 18px;
}


.stat-card {
    padding: 21px;

    min-height: 155px;

    background: var(--panel);

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

    border-radius: var(--radius);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease;

    box-shadow:
        0 10px 35px rgba(0, 0, 0, 0.1);
}


.stat-card:hover {
    transform: translateY(-3px);

    border-color: rgba(56, 189, 248, 0.18);
}


.critical-card {
    border-color: rgba(239, 68, 68, 0.12);
}


.high-card {
    border-color: rgba(245, 158, 11, 0.12);
}


.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}


.stat-icon {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 10px;

    font-weight: 900;
}


.stat-icon.blue {
    color: var(--blue);
    background: rgba(56, 189, 248, 0.09);
}


.stat-icon.red {
    color: var(--red);
    background: rgba(239, 68, 68, 0.09);
}


.stat-icon.orange {
    color: var(--orange);
    background: rgba(245, 158, 11, 0.09);
}


.stat-icon.purple {
    color: var(--purple);
    background: rgba(167, 139, 250, 0.09);
}


.stat-label {
    color: #657991;

    font-size: 9px;
    font-weight: 900;

    letter-spacing: 1.4px;
}


.stat-value {
    display: block;

    margin-top: 18px;

    font-size: 34px;

    line-height: 1;

    letter-spacing: -1.5px;
}


.stat-card p {
    margin-top: 8px;

    color: var(--muted);

    font-size: 11px;
}


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

.dashboard-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 18px;

    margin-top: 18px;
}


/* =========================================================
   PANEL
   ========================================================= */

.panel {
    background:
        linear-gradient(
            180deg,
            rgba(13, 27, 46, 0.98),
            rgba(10, 23, 39, 0.98)
        );

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

    border-radius: var(--radius);

    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.13);
}


.panel-header {
    min-height: 75px;

    padding: 19px 22px;

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

    border-bottom: 1px solid var(--border);
}


.panel-eyebrow {
    display: block;

    color: #68809b;

    font-size: 9px;
    font-weight: 900;

    letter-spacing: 1.4px;
}


.panel-header h3 {
    margin-top: 4px;

    font-size: 17px;

    letter-spacing: -0.3px;
}


.panel-icon {
    color: var(--blue);

    font-size: 18px;
}


.text-button {
    border: 0;

    background: transparent;

    color: var(--blue);

    font-size: 11px;
    font-weight: 800;
}


.text-button:hover {
    text-decoration: underline;
}


/* =========================================================
   RISK PANEL
   ========================================================= */

.risk-chart {
    min-height: 250px;

    padding: 27px;

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

    gap: 40px;
}


.risk-ring {
    width: 175px;
    height: 175px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background:
        conic-gradient(
            var(--blue) 0deg,
            rgba(56, 189, 248, 0.12) 0deg
        );

    position: relative;
}


.risk-ring::before {
    content: "";

    position: absolute;

    inset: 10px;

    border-radius: 50%;

    background: var(--panel);
}


.risk-ring-inner {
    position: relative;
    z-index: 2;

    text-align: center;
}


.risk-ring-inner strong {
    display: block;

    font-size: 36px;

    line-height: 1;
}


.risk-ring-inner span {
    color: var(--muted);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 1px;
}


.risk-legend {
    min-width: 145px;
}


.legend-item {
    display: grid;

    grid-template-columns: 10px 1fr auto;

    align-items: center;

    gap: 8px;

    padding: 9px 0;

    color: #aab8c8;

    font-size: 12px;
}


.legend-item strong {
    color: white;
}


.legend-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;
}


.critical-dot {
    background: var(--red);
}


.high-dot {
    background: var(--orange);
}


.medium-dot {
    background: #eab308;
}


.low-dot {
    background: var(--green);
}


/* =========================================================
   FINDING METRICS
   ========================================================= */

.finding-metrics {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 12px;

    padding: 20px;
}


.finding-box {
    padding: 20px;

    border-radius: 12px;

    background: rgba(255, 255, 255, 0.025);

    border: 1px solid var(--border);
}


.finding-box span {
    display: block;

    color: var(--muted);

    font-size: 11px;
}


.finding-box strong {
    display: block;

    margin-top: 8px;

    font-size: 29px;
}


/* =========================================================
   RECENT FINDINGS
   ========================================================= */

.recent-findings {
    padding: 0 20px 20px;
}


.recent-finding {
    padding: 12px 0;

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

    border-top: 1px solid var(--border);
}


.recent-finding strong {
    display: block;

    font-size: 12px;
}


.recent-finding small {
    color: var(--muted);

    font-size: 10px;
}


/* =========================================================
   OVERVIEW
   ========================================================= */

.overview-panel {
    margin-top: 18px;
}


.asset-preview {
    padding: 12px 20px 20px;
}


.asset-preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 14px 0;

    border-bottom: 1px solid var(--border);
}


.asset-preview-item:last-child {
    border-bottom: 0;
}


.asset-preview-item strong {
    display: block;

    font-size: 12px;
}


.asset-preview-item small {
    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 10px;
}


/* =========================================================
   SECTION HEADING
   ========================================================= */

.section-heading {
    display: flex;

    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 22px;
}


.section-heading h1 {
    margin-top: 5px;

    font-size: 30px;

    letter-spacing: -1px;
}


.section-heading p {
    margin-top: 6px;

    color: var(--muted);

    font-size: 12px;
}


/* =========================================================
   FORM PANEL
   ========================================================= */

.form-panel {
    margin-bottom: 18px;
}


.form-panel form {
    padding: 22px;
}


.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;
}


.form-group label {
    display: block;

    margin-bottom: 7px;

    color: #b7c4d4;

    font-size: 11px;
    font-weight: 700;
}


.form-group input,
.form-group select {
    width: 100%;

    height: 45px;

    padding: 0 13px;

    color: #e8eef6;

    background: #081525;

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

    border-radius: 9px;

    outline: none;

    transition: 0.2s;
}


.form-group input::placeholder {
    color: #53677f;
}


.form-group select {
    cursor: pointer;
}


.form-group input:focus,
.form-group select:focus {
    border-color: rgba(56, 189, 248, 0.55);

    box-shadow:
        0 0 0 3px rgba(56, 189, 248, 0.08);
}


.form-actions {
    display: flex;

    gap: 10px;

    margin-top: 20px;
}


.form-message {
    min-height: 20px;

    margin-top: 13px;

    color: var(--muted);

    font-size: 11px;
}


.form-message.success {
    color: #86efac;
}


.form-message.error {
    color: #fca5a5;
}


/* =========================================================
   TABLE
   ========================================================= */

.table-panel {
    overflow: hidden;
}


.count-badge {
    padding: 6px 10px;

    border-radius: 999px;

    color: #9ecff1;

    background: rgba(56, 189, 248, 0.07);

    border: 1px solid rgba(56, 189, 248, 0.13);

    font-size: 10px;
    font-weight: 800;
}


.table-wrapper {
    width: 100%;

    overflow-x: auto;
}


.data-table {
    width: 100%;

    min-width: 900px;

    border-collapse: collapse;
}


.data-table th {
    padding: 13px 20px;

    background: rgba(255, 255, 255, 0.018);

    color: #71859d;

    font-size: 9px;
    font-weight: 900;

    letter-spacing: 1px;

    text-align: left;

    white-space: nowrap;
}


.data-table td {
    padding: 16px 20px;

    border-top: 1px solid var(--border);

    color: #b8c5d5;

    font-size: 11px;

    vertical-align: middle;
}


.data-table tbody tr {
    transition: background 0.2s ease;
}


.data-table tbody tr:hover {
    background: rgba(56, 189, 248, 0.025);
}


.table-asset-name strong {
    color: #eef5fb;

    font-size: 12px;
}


.data-table code {
    color: #93c5fd;

    font-size: 10px;
}


.table-empty {
    padding: 45px 20px !important;

    color: #647891 !important;

    text-align: center;
}


.error-state {
    color: #fca5a5 !important;
}


/* =========================================================
   BADGES
   ========================================================= */

.risk-badge,
.status-badge {
    display: inline-flex;

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

    min-width: 52px;

    padding: 5px 8px;

    border-radius: 7px;

    font-size: 9px;
    font-weight: 900;

    text-transform: uppercase;
}


.risk-badge.critical {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.11);
}


.risk-badge.high {
    color: #fdba74;
    background: rgba(245, 158, 11, 0.11);
}


.risk-badge.medium {
    color: #fde68a;
    background: rgba(234, 179, 8, 0.1);
}


.risk-badge.low {
    color: #86efac;
    background: rgba(34, 197, 94, 0.1);
}


.risk-badge.unknown {
    color: #aab8c8;
    background: rgba(148, 163, 184, 0.08);
}


.status-badge {
    color: #86efac;

    background: rgba(34, 197, 94, 0.08);
}


.status-badge.online {
    color: #86efac;
}


.table-actions {
    display: flex;
    gap: 7px;
}


.table-action-btn {
    width: 31px;
    height: 31px;

    border-radius: 8px;

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

    background: rgba(255, 255, 255, 0.025);

    color: #9fb2c7;

    transition: 0.2s;
}


.table-action-btn:hover {
    color: white;

    border-color: rgba(56, 189, 248, 0.35);

    background: rgba(56, 189, 248, 0.08);
}


.table-action-btn.danger:hover {
    color: #fecaca;

    border-color: rgba(239, 68, 68, 0.35);

    background: rgba(239, 68, 68, 0.08);
}


/* =========================================================
   RISK PAGE
   ========================================================= */

.risk-overview-panel {
    overflow: hidden;
}


.risk-assets {
    padding: 20px;
}


.risk-asset-card {
    display: flex;

    align-items: center;
    justify-content: space-between;

    padding: 18px;

    margin-bottom: 10px;

    background: rgba(255, 255, 255, 0.025);

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

    border-radius: 12px;
}


.risk-asset-card:last-child {
    margin-bottom: 0;
}


.risk-asset-card strong {
    display: block;

    font-size: 13px;
}


.risk-asset-card > div:first-child span {
    display: block;

    margin-top: 4px;

    color: var(--muted);

    font-size: 10px;
}


.risk-score-display {
    display: flex;

    align-items: center;

    gap: 12px;
}


.risk-score-display > strong {
    font-size: 25px;
}


/* =========================================================
   SYSTEM PAGE
   ========================================================= */

.system-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 15px;

    margin-bottom: 18px;
}


.system-card {
    min-height: 115px;

    display: flex;
    align-items: center;

    gap: 13px;

    padding: 20px;

    background: var(--panel);

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

    border-radius: var(--radius);
}


.system-card-icon {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border-radius: 11px;

    color: var(--blue);

    background: rgba(56, 189, 248, 0.08);
}


.system-card span {
    display: block;

    color: var(--muted);

    font-size: 10px;
}


.system-card strong {
    display: block;

    margin-top: 5px;

    font-size: 12px;
}


.system-online {
    color: #86efac;
}


.system-offline {
    color: #fca5a5;
}


/* =========================================================
   API INFO
   ========================================================= */

.api-info-panel {
    overflow: hidden;
}


.api-info-grid {
    padding: 8px 22px 20px;
}


.info-row {
    min-height: 55px;

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

    gap: 20px;

    border-bottom: 1px solid var(--border);
}


.info-row:last-child {
    border-bottom: 0;
}


.info-row > span {
    color: var(--muted);

    font-size: 11px;
}


.info-row code {
    padding: 5px 8px;

    border-radius: 6px;

    color: #9ecff1;

    background: rgba(56, 189, 248, 0.05);

    font-size: 10px;
}


.info-row a {
    color: var(--blue);

    font-size: 11px;
    font-weight: 700;
}


.info-row a:hover {
    text-decoration: underline;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    min-height: 190px;

    display: flex;

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

    flex-direction: column;

    text-align: center;

    padding: 30px;
}


.empty-state > span {
    display: grid;
    place-items: center;

    width: 44px;
    height: 44px;

    margin-bottom: 10px;

    border-radius: 12px;

    color: var(--blue);

    background: rgba(56, 189, 248, 0.07);
}


.empty-state h4 {
    font-size: 13px;
}


.empty-state p {
    max-width: 380px;

    margin-top: 5px;

    color: var(--muted);

    font-size: 11px;
}


.empty-state.small {
    min-height: 100px;

    flex-direction: row;

    gap: 10px;

    justify-content: flex-start;

    text-align: left;

    padding: 12px 0;
}


.empty-state.small > span {
    width: 32px;
    height: 32px;

    margin: 0;
}


.empty-state.small p {
    margin: 0;
}


/* =========================================================
   TOAST
   ========================================================= */

.toast-container {
    position: fixed;

    right: 22px;
    bottom: 22px;

    z-index: 3000;

    display: flex;

    flex-direction: column;

    gap: 10px;
}


.toast {
    min-width: 280px;

    padding: 13px 15px;

    border-radius: 11px;

    background: #102238;

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

    box-shadow: var(--shadow);

    color: #dbeafe;

    font-size: 11px;

    opacity: 0;

    transform: translateY(15px);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}


.toast.show {
    opacity: 1;

    transform: translateY(0);
}


.toast-content {
    display: flex;

    align-items: center;

    gap: 10px;
}


.toast-icon {
    width: 25px;
    height: 25px;

    display: grid;
    place-items: center;

    border-radius: 7px;

    font-weight: 900;
}


.toast-success .toast-icon {
    color: #86efac;

    background: rgba(34, 197, 94, 0.1);
}


.toast-error .toast-icon {
    color: #fca5a5;

    background: rgba(239, 68, 68, 0.1);
}


.toast-info .toast-icon {
    color: #93c5fd;

    background: rgba(59, 130, 246, 0.1);
}


/* =========================================================
   MODAL
   ========================================================= */

.modal-overlay {
    position: fixed;

    inset: 0;

    z-index: 2500;

    display: flex;

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

    padding: 20px;

    background: rgba(0, 0, 0, 0.68);

    backdrop-filter: blur(6px);

    opacity: 0;

    visibility: hidden;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}


.modal-overlay.show {
    opacity: 1;

    visibility: visible;
}


.modal {
    width: min(620px, 100%);

    max-height: 85vh;

    overflow: auto;

    background: #0d1b2e;

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

    border-radius: 17px;

    box-shadow:
        0 30px 100px rgba(0, 0, 0, 0.55);

    transform: translateY(15px) scale(0.98);

    transition: transform 0.2s ease;
}


.modal-overlay.show .modal {
    transform: translateY(0) scale(1);
}


.modal-header {
    min-height: 75px;

    padding: 17px 20px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border);
}


.modal-header h3 {
    margin-top: 3px;

    font-size: 17px;
}


.modal-close {
    width: 35px;
    height: 35px;

    display: grid;
    place-items: center;

    border-radius: 9px;

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

    background: rgba(255, 255, 255, 0.025);

    color: #aab8c8;

    font-size: 22px;
}


.modal-close:hover {
    color: white;

    background: rgba(239, 68, 68, 0.08);
}


.modal-body {
    padding: 22px;
}


.modal-actions {
    display: flex;

    justify-content: flex-end;

    padding: 0 22px 22px;
}


.modal-risk-result {
    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 12px;

    margin-bottom: 18px;
}


.modal-score,
.modal-level {
    padding: 18px;

    border-radius: 12px;

    background: rgba(255, 255, 255, 0.025);

    border: 1px solid var(--border);
}


.modal-score span,
.modal-level span {
    display: block;

    color: var(--muted);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 1px;
}


.modal-score strong,
.modal-level strong {
    display: block;

    margin-top: 7px;

    font-size: 27px;
}


.modal-json {
    overflow: auto;

    padding: 15px;

    border-radius: 10px;

    background: #06101c;

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

    color: #9ecff1;

    font-size: 10px;

    white-space: pre-wrap;

    word-break: break-word;
}


/* =========================================================
   FOOTER
   ========================================================= */

.footer {
    margin-top: auto;

    min-height: 70px;

    padding: 18px 32px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    color: #596d84;

    border-top: 1px solid var(--border);

    font-size: 10px;
}


.footer strong {
    color: #8da0b5;
}


.footer span {
    margin-left: 8px;
}


/* =========================================================
   RESPONSIVE - TABLET
   ========================================================= */

@media (max-width: 1100px) {

    :root {
        --sidebar-width: 220px;
    }


    .content {
        padding: 24px;
    }


    .hero-panel {
        padding: 35px;
    }


    .hero-visual {
        width: 230px;
        flex-basis: 230px;
    }


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


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


/* =========================================================
   RESPONSIVE - MOBILE
   ========================================================= */

@media (max-width: 800px) {

    .sidebar {
        transform: translateX(-100%);

        box-shadow:
            20px 0 60px rgba(0, 0, 0, 0.4);
    }


    .sidebar.sidebar-open {
        transform: translateX(0);
    }


    .main-area {
        width: 100%;

        margin-left: 0;
    }


    .topbar {
        padding: 0 17px;
    }


    .menu-button {
        display: grid;

        place-items: center;

        margin-right: 10px;
    }


    .topbar {
        justify-content: flex-start;
    }


    .topbar-title {
        flex: 1;
    }


    .topbar-title h2 {
        font-size: 15px;
    }


    .topbar-actions {
        gap: 6px;
    }


    .connection-status {
        padding: 7px;

        border-radius: 9px;
    }


    .connection-status .status-dot {
        margin-right: 0;
    }


    #connectionText {
        display: none;
    }


    .content {
        padding: 18px;
    }


    .hero-panel {
        min-height: auto;

        padding: 30px 25px;
    }


    .hero-visual {
        display: none;
    }


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


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


    .section-heading {
        align-items: flex-start;

        flex-direction: column;
    }


    .section-heading .btn {
        width: 100%;
    }


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


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


    .footer {
        flex-direction: column;

        align-items: flex-start;

        padding: 18px;
    }
}


/* =========================================================
   RESPONSIVE - SMALL MOBILE
   ========================================================= */

@media (max-width: 520px) {

    .content {
        padding: 13px;
    }


    .hero-panel {
        padding: 25px 20px;

        border-radius: 16px;
    }


    .hero-content h1 {
        font-size: 34px;

        letter-spacing: -1.7px;
    }


    .hero-content > p {
        font-size: 12px;
    }


    .hero-actions {
        flex-direction: column;
    }


    .hero-actions .btn {
        width: 100%;
    }


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


    .risk-chart {
        flex-direction: column;

        gap: 22px;
    }


    .risk-ring {
        width: 150px;
        height: 150px;
    }


    .risk-legend {
        width: 100%;
    }


    .finding-metrics {
        grid-template-columns: 1fr;
    }


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


    .form-actions {
        flex-direction: column;
    }


    .form-actions .btn {
        width: 100%;
    }


    .panel-header {
        padding: 16px;
    }


    .section-heading h1 {
        font-size: 25px;
    }


    .info-row {
        align-items: flex-start;

        flex-direction: column;

        justify-content: center;

        gap: 5px;

        padding: 13px 0;
    }


    .modal-risk-result {
        grid-template-columns: 1fr;
    }


    .toast-container {
        left: 13px;
        right: 13px;
        bottom: 13px;
    }


    .toast {
        min-width: 0;
        width: 100%;
    }
}

/* =========================================================
   ASSET TABLE ACTION BUTTONS
========================================================= */

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.small-action {
    appearance: none;
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: rgba(37, 99, 235, 0.14);
    color: #60a5fa;
    padding: 8px 14px;
    min-height: 34px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.small-action:hover {
    background: #2563eb;
    border-color: #3b82f6;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.small-action:active {
    transform: translateY(0);
}

.small-action.danger {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.small-action.danger:hover {
    background: #dc2626;
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.25);
}


/* =========================================================
   STATUS BADGES
========================================================= */

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(100, 116, 139, 0.12);
    color: #cbd5e1;
}

.status-badge.online {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.28);
    color: #34d399;
}


/* =========================================================
   RISK BADGES
========================================================= */

.risk-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 6px 11px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.risk-badge.low {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.risk-badge.medium {
    background: rgba(234, 179, 8, 0.13);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.28);
}

.risk-badge.high {
    background: rgba(249, 115, 22, 0.13);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.28);
}

.risk-badge.critical {
    background: rgba(239, 68, 68, 0.13);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.28);
}
