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

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #f5f7fa;

    color: #172033;
}


/* ==========================================================================
   APP
========================================================================== */

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


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

.sidebar {
    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    width: 250px;

    display: flex;
    flex-direction: column;

    background: #111827;

    color: #ffffff;

    border-right: 1px solid #1f2937;
}


.brand {
    height: 78px;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 0 22px;

    border-bottom: 1px solid #1f2937;
}


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

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

    border-radius: 10px;

    background: #1f2937;

    font-size: 20px;
}


.brand-text {
    display: flex;
    flex-direction: column;

    gap: 2px;
}


.brand-text strong {
    font-size: 15px;
}


.brand-text span {
    font-size: 11px;

    color: #9ca3af;
}


/* ==========================================================================
   NAVIGATION
========================================================================== */

.navigation {
    display: flex;
    flex-direction: column;

    gap: 5px;

    padding: 20px 12px;
}


.nav-item {
    display: flex;
    align-items: center;

    gap: 12px;

    min-height: 44px;

    padding: 0 13px;

    border-radius: 8px;

    color: #9ca3af;

    text-decoration: none;

    font-size: 14px;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}


.nav-item:hover {
    background: #1f2937;
    color: #ffffff;
}


.nav-icon {
    width: 22px;

    text-align: center;

    font-size: 16px;
}


.sidebar-footer {
    margin-top: auto;

    padding: 18px;

    border-top: 1px solid #1f2937;
}


.system-status {
    display: flex;
    align-items: center;

    gap: 9px;

    color: #9ca3af;

    font-size: 12px;
}


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

.main-content {
    width: calc(100% - 250px);

    margin-left: 250px;

    min-height: 100vh;
}


.topbar {
    height: 78px;

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

    padding: 0 32px;

    background: #ffffff;

    border-bottom: 1px solid #e5e7eb;
}


.topbar h1 {
    margin: 0;

    font-size: 20px;

    font-weight: 650;
}


.topbar-status {
    display: flex;
    align-items: center;

    gap: 8px;

    font-size: 12px;

    color: #667085;
}


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

.page-content {
    padding: 32px;
}


.dashboard-header {
    margin-bottom: 28px;
}


.eyebrow {
    margin: 0 0 6px;

    font-size: 11px;

    font-weight: 700;

    letter-spacing: 0.08em;

    color: #667085;
}


.dashboard-header h2 {
    margin: 0 0 6px;

    font-size: 27px;

    font-weight: 700;
}


.page-description {
    margin: 0;

    color: #667085;

    font-size: 14px;
}


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

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

    flex-shrink: 0;

    border-radius: 50%;

    background: #22c55e;

    box-shadow:
        0 0 0 3px rgba(34, 197, 94, 0.12);
}


/* ==========================================================================
   STATISTICS
========================================================================== */

.stat-grid {
    display: grid;

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

    gap: 18px;

    margin-bottom: 20px;
}


.stat-card {
    padding: 22px;

    background: #ffffff;

    border: 1px solid #e5e7eb;

    border-radius: 12px;

    box-shadow:
        0 1px 2px rgba(16, 24, 40, 0.04);
}


.stat-label {
    font-size: 12px;

    color: #667085;

    margin-bottom: 10px;
}


.stat-value {
    font-size: 28px;

    font-weight: 700;

    letter-spacing: -0.02em;
}


.stat-meta {
    margin-top: 8px;

    font-size: 11px;

    color: #98a2b3;
}


/* ==========================================================================
   PANELS
========================================================================== */

.panel-grid {
    display: grid;

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

    gap: 20px;

    margin-bottom: 20px;
}


.panel {
    background: #ffffff;

    border: 1px solid #e5e7eb;

    border-radius: 12px;

    box-shadow:
        0 1px 2px rgba(16, 24, 40, 0.04);

    overflow: hidden;
}


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

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

    padding: 16px 20px;

    border-bottom: 1px solid #eef0f3;
}


.panel-header h3 {
    margin: 0 0 3px;

    font-size: 15px;
}


.panel-header span {
    font-size: 11px;

    color: #98a2b3;
}


.panel-link {
    font-size: 12px;

    color: #475467;

    text-decoration: none;
}


.panel-link:hover {
    text-decoration: underline;
}


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

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

    display: flex;
    flex-direction: column;

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

    padding: 30px;

    text-align: center;
}


.empty-icon {
    width: 42px;
    height: 42px;

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

    margin-bottom: 12px;

    border-radius: 10px;

    background: #f2f4f7;

    color: #667085;

    font-size: 18px;
}


.empty-state h4 {
    margin: 0 0 6px;

    font-size: 14px;
}


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

    margin: 0;

    color: #98a2b3;

    font-size: 12px;

    line-height: 1.6;
}


/* ==========================================================================
   COMPONENTS
========================================================================== */

.component-grid {
    display: grid;

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

    padding: 18px;

    gap: 12px;
}


.component {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 14px;

    background: #f8fafc;

    border: 1px solid #eef0f3;

    border-radius: 9px;
}


.component > div {
    display: flex;
    flex-direction: column;

    gap: 3px;
}


.component strong {
    font-size: 12px;
}


.component span {
    font-size: 10px;

    color: #98a2b3;
}


/* ==========================================================================
   RESPONSIVE
========================================================================== */

@media (max-width: 1100px) {

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

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

}


@media (max-width: 800px) {

    .sidebar {
        width: 70px;
    }

    .brand-text,
    .nav-item span:not(.nav-icon),
    .system-status span:not(.status-dot) {
        display: none;
    }

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

    .navigation {
        padding: 15px 10px;
    }

    .nav-item {
        justify-content: center;
        padding: 0;
    }

    .main-content {
        width: calc(100% - 70px);

        margin-left: 70px;
    }

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

}


@media (max-width: 560px) {

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

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

    .page-content {
        padding: 20px;
    }

    .topbar {
        padding: 0 20px;
    }

}
/* ==========================================================================
   DATA TABLE
========================================================================== */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

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

.data-table th {
    padding: 11px 14px;

    text-align: left;

    font-size: 10px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.04em;

    color: #98a2b3;

    background: #fafbfc;

    border-bottom: 1px solid #eef0f3;
}

.data-table td {
    padding: 12px 14px;

    font-size: 12px;

    color: #475467;

    border-bottom: 1px solid #f2f4f7;

    white-space: nowrap;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: #fafbfc;
}

.path-cell {
    max-width: 220px;

    overflow: hidden;

    text-overflow: ellipsis;
}


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

.badge {
    display: inline-flex;

    align-items: center;

    padding: 4px 8px;

    border-radius: 5px;

    font-size: 9px;

    font-weight: 700;

    letter-spacing: 0.03em;
}

.badge-success {
    background: #ecfdf3;

    color: #027a48;
}

.badge-danger {
    background: #fef3f2;

    color: #b42318;
}

.badge-warning {
    background: #fffaeb;

    color: #b54708;
}
/* ==========================================================================
   LIVE TRAFFIC
========================================================================== */

.traffic-live-indicator {
    display: flex;

    align-items: center;

    gap: 8px;

    font-size: 11px;

    color: #667085;
}


.traffic-table {
    min-width: 1050px;
}


.ip-address {
    font-family:
        "Cascadia Code",
        "Consolas",
        monospace;

    font-size: 11px;

    color: #344054;
}


.method-badge {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 46px;

    padding: 4px 7px;

    border-radius: 5px;

    background: #f2f4f7;

    color: #475467;

    font-size: 9px;

    font-weight: 700;
}


.request-cell {
    min-width: 220px;

    max-width: 340px;
}


.request-path {
    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    font-family:
        "Cascadia Code",
        "Consolas",
        monospace;

    font-size: 11px;

    color: #344054;
}


.request-query {
    max-width: 320px;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    margin-top: 3px;

    font-family:
        "Cascadia Code",
        "Consolas",
        monospace;

    font-size: 9px;

    color: #98a2b3;
}


.status-code {
    font-family:
        "Cascadia Code",
        "Consolas",
        monospace;

    font-size: 11px;

    color: #475467;
}


.detection-source {
    display: inline-block;

    max-width: 120px;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    font-size: 10px;

    color: #667085;
}


.muted {
    color: #98a2b3;
}


.risk-score {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 30px;

    padding: 4px 6px;

    border-radius: 5px;

    font-size: 10px;

    font-weight: 700;
}


.risk-low {
    background: #ecfdf3;

    color: #027a48;
}


.risk-medium {
    background: #fffaeb;

    color: #b54708;
}


.risk-high {
    background: #fff4e5;

    color: #c4320a;
}


.risk-critical {
    background: #fef3f2;

    color: #b42318;
}


.badge-info {
    background: #eff8ff;

    color: #175cd3;
}
/* ==========================================================================
   ATTACK EVENTS
========================================================================== */

.attack-table {
    min-width: 1000px;
}


.attack-type {
    display: inline-flex;

    align-items: center;

    padding: 5px 8px;

    border-radius: 5px;

    background: #fef3f2;

    color: #b42318;

    font-size: 10px;

    font-weight: 650;

    white-space: nowrap;
}


.attack-payload {
    max-width: 320px;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    margin-top: 4px;

    padding: 4px 6px;

    border-radius: 4px;

    background: #f8fafc;

    border: 1px solid #eef0f3;

    font-family:
        "Cascadia Code",
        "Consolas",
        monospace;

    font-size: 9px;

    color: #667085;
}
/* ==========================================================================
   BANNED IPs
========================================================================== */

.banned-ip-table {
    min-width: 1050px;
}


.ban-reason {
    display: inline-block;

    max-width: 220px;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    font-size: 11px;

    color: #475467;
}


.date-value {
    font-family:
        "Cascadia Code",
        "Consolas",
        monospace;

    font-size: 10px;

    color: #667085;

    white-space: nowrap;
}


.permanent-label {
    font-size: 10px;

    font-weight: 600;

    color: #b42318;
}


.inline-form {
    display: inline;
}


.action-button {
    border: 1px solid #d0d5dd;

    background: #ffffff;

    color: #344054;

    padding: 6px 10px;

    border-radius: 6px;

    font-size: 10px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}


.action-button:hover {
    background: #f2f4f7;

    border-color: #98a2b3;
}
/* =========================================================================
   LOGOUT BUTTON
========================================================================= */

.logout-button {
    display: flex;
    align-items: center;
    gap: 10px;

    width: 100%;

    margin-top: 14px;
    padding: 10px 12px;

    border-radius: 8px;

    color: #c7cfdd;

    text-decoration: none;

    font-size: 14px;

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

.logout-button:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.logout-icon {
    width: 20px;

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

    font-size: 16px;
}