/* =========================================================
   NWH Digital Alerts
   Main Stylesheet
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    background: #0f172a;
    color: #e5e7eb;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}


/* =========================================================
   Navigation
   ========================================================= */

.main-nav {
    background: #111827;
    border-bottom: 1px solid #263244;
}

.nav-container {
    width: 94%;
    max-width: 1400px;
    min-height: 64px;

    margin: 0 auto;

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

.nav-brand {
    color: #f8fafc;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links a {
    padding: 9px 14px;

    color: #9ca3af;
    text-decoration: none;

    border-radius: 6px;

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

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

.nav-links a.active {
    background: #334155;
    color: #ffffff;
}


/* =========================================================
   Main Content
   ========================================================= */

.site-content {
    width: 94%;
    max-width: 1400px;

    margin: 0 auto;
    padding: 32px 0 48px;

    flex: 1;
}

.page-header {
    margin-bottom: 26px;
}

.page-header h1 {
    margin: 0 0 6px;

    color: #f8fafc;
    font-size: 28px;
}

.page-header p {
    margin: 0;
    color: #94a3b8;
}


/* =========================================================
   Cards
   ========================================================= */

.card-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));

    gap: 18px;
}

.card {
    padding: 22px;

    background: #1e293b;

    border: 1px solid #334155;
    border-radius: 8px;
}

.card h2,
.card h3 {
    margin-top: 0;
    color: #f8fafc;
}

.card-label {
    margin-bottom: 8px;

    color: #94a3b8;

    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-value {
    color: #f8fafc;

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


/* =========================================================
   Status Indicators
   ========================================================= */

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

    padding: 5px 10px;

    border-radius: 20px;

    font-size: 13px;
    font-weight: 600;
}

.status-online {
    background: #14532d;
    color: #bbf7d0;
}

.status-warning {
    background: #713f12;
    color: #fde68a;
}

.status-critical {
    background: #7f1d1d;
    color: #fecaca;
}

.status-unknown {
    background: #334155;
    color: #cbd5e1;
}


/* =========================================================
   Tables
   ========================================================= */

.table-container {
    overflow-x: auto;

    background: #1e293b;

    border: 1px solid #334155;
    border-radius: 8px;
}

table {
    width: 100%;

    border-collapse: collapse;
}

th,
td {
    padding: 12px 14px;

    text-align: left;

    border-bottom: 1px solid #334155;
}

th {
    background: #172033;
    color: #cbd5e1;

    font-size: 13px;
}

td {
    color: #e2e8f0;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: #263449;
}


/* =========================================================
   Footer
   ========================================================= */

.site-footer {
    background: #111827;
    border-top: 1px solid #263244;

    color: #64748b;

    font-size: 12px;
}

.footer-container {
    width: 94%;
    max-width: 1400px;

    min-height: 60px;

    margin: 0 auto;
    padding: 10px 0;

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

    gap: 20px;
}

.footer-main,
.footer-system {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-separator {
    color: #334155;
}


/* =========================================================
   Responsive Layout
   ========================================================= */

@media (max-width: 800px) {

    .nav-container {
        padding: 14px 0;

        flex-direction: column;
        align-items: flex-start;

        gap: 12px;
    }

    .nav-links {
        width: 100%;

        overflow-x: auto;
    }

    .nav-links a {
        white-space: nowrap;
    }

    .footer-container {
        padding: 16px 0;

        flex-direction: column;
        align-items: flex-start;

        gap: 6px;
    }

    .footer-main,
    .footer-system {
        flex-wrap: wrap;
    }
}

/* =========================================================
   Systems Monitoring
   ========================================================= */

.system-card {
    margin-bottom: 24px;
    overflow: hidden;
}

.system-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid #30363d;
}

.system-card-header h2 {
    margin: 0 0 6px 0;
}

.system-address {
    color: #8b949e;
    font-family: monospace;
    font-size: 0.95rem;
}


/* Status Badges */

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.status-online {
    color: #3fb950;
    background: rgba(46, 160, 67, 0.14);
    border: 1px solid rgba(63, 185, 80, 0.45);
}

.status-offline {
    color: #f85149;
    background: rgba(248, 81, 73, 0.14);
    border: 1px solid rgba(248, 81, 73, 0.45);
}

.status-warning {
    color: #d29922;
    background: rgba(210, 153, 34, 0.14);
    border: 1px solid rgba(210, 153, 34, 0.45);
}

.status-unknown {
    color: #8b949e;
    background: rgba(139, 148, 158, 0.12);
    border: 1px solid rgba(139, 148, 158, 0.35);
}


/* System Details */

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

.detail-item {
    padding: 14px 16px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
}

.detail-label {
    display: block;
    margin-bottom: 7px;
    color: #8b949e;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-value {
    color: #f0f6fc;
    font-size: 0.95rem;
    font-weight: 600;
}


/* Internet / WAN */

.wan-section {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #30363d;
}

.wan-section h3,
.services-section h3 {
    margin: 0 0 14px 0;
    font-size: 1rem;
    color: #c9d1d9;
}


/* Services */

.services-section {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #30363d;
}

.no-services {
    margin: 0;
    padding: 14px 16px;
    color: #8b949e;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
}

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

.monitor-table {
    width: 100%;
    border-collapse: collapse;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
}

.monitor-table th,
.monitor-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #21262d;
    white-space: nowrap;
}

.monitor-table th {
    color: #8b949e;
    background: #161b22;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.monitor-table td {
    color: #c9d1d9;
    font-size: 0.9rem;
}

.monitor-table tbody tr:last-child td {
    border-bottom: 0;
}

.monitor-table tbody tr:hover {
    background: #161b22;
}


/* Service Error */

.service-error-row td {
    color: #f85149;
    background: rgba(248, 81, 73, 0.08);
    white-space: normal;
}


/* Responsive Layout */

@media (max-width: 1000px) {
    .system-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .system-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .status-badge {
        min-width: 74px;
    }
}
/* Navigation logout button */

/* Navigation logout button */

.nav-logout {
    display: flex;
    align-items: center;
    margin: 0;
}

.nav-links .nav-logout-button {
    display: inline-block;
    padding: 9px 14px;

    background: transparent;
    border: none;
    border-radius: 6px;

    color: #9ca3af;
    font: inherit;
    line-height: inherit;
    cursor: pointer;

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

.nav-links .nav-logout-button:hover {
    background: #1f2937;
    color: #ffffff;
}

.nav-links .nav-logout-button:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 3px;
}
