/* Watchdog Monitor V4.0 */

:root {
    --bg: #080e1a;
    --panel: #0f172a;
    --panel2: #111827;
    --border: #1f2937;
    --text: #f8fafc;
    --muted: #cbd5e1;
    --green: #22c55e;
    --yellow: #f59e0b;
    --red: #ef4444;
    --blue: #38bdf8;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: radial-gradient(circle at top left, #132033 0%, var(--bg) 38%, #050816 100%);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { text-decoration: none; }

.muted { color: var(--muted); }

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

.sidebar {
    width: 290px;
    background: rgba(15, 23, 42, 0.92);
    border-right: 1px solid var(--border);
    padding: 22px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
}

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 32px;
}

.brand img {
    width: 62px;
    height: 62px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid rgba(34, 197, 94, 0.45);
}

.brand-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .3px;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 12px;
}

.menu {
    display: grid;
    gap: 8px;
}

.menu a {
    color: var(--muted);
    padding: 12px 14px;
    border-radius: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    transition: .15s ease;
}

.menu a:hover, .menu a.active {
    background: rgba(34, 197, 94, 0.12);
    color: #ffffff;
}

.sidebar-footer {
    margin-top: 36px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.7;
}

.content {
    margin-left: 290px;
    width: calc(100% - 290px);
    padding: 26px;
}

.topbar {
    background: rgba(17, 24, 39, 0.72);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    backdrop-filter: blur(12px);
}

.topbar h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
}

.userbox {
    display: flex;
    gap: 14px;
    align-items: center;
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card, .pc-card, .process-item, .event-item {
    background: rgba(17, 24, 39, 0.86);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    color: var(--text);
    box-shadow: 0 16px 40px rgba(0,0,0,.18);
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
}

.stat-value {
    font-size: 32px;
    font-weight: 900;
}

.section {
    margin-bottom: 28px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 14px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
}

.pc-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 16px;
}

.pc-card {
    transition: .18s ease;
}

.pc-card:hover {
    transform: translateY(-2px);
    border-color: rgba(34,197,94,.35);
}

.pc-title {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.pc-name {
    font-weight: 800;
    font-size: 17px;
    color: #ffffff;
}

.badge-status {
    font-size: 11px;
    border-radius: 999px;
    padding: 6px 9px;
    font-weight: 800;
    letter-spacing: .4px;
}

.badge-online { background: rgba(34,197,94,.14); color: var(--green); }
.badge-warning { background: rgba(245,158,11,.16); color: var(--yellow); }
.badge-offline { background: rgba(239,68,68,.16); color: var(--red); }

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

.dot-online { background: var(--green); box-shadow: 0 0 16px rgba(34,197,94,.8); animation: pulse 1.4s infinite; }
.dot-warning { background: var(--yellow); }
.dot-offline { background: var(--red); box-shadow: 0 0 16px rgba(239,68,68,.7); }

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: .42; transform: scale(.85); }
    100% { opacity: 1; transform: scale(1); }
}

.two-columns {
    display: grid;
    grid-template-columns: 1.3fr .9fr;
    gap: 18px;
}

.process-list, .events-list {
    display: grid;
    gap: 10px;
}

.process-item, .event-item {
    padding: 14px 16px;
}

.process-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.process-name {
    font-weight: 700;
    color: #ffffff;
}

.process-pc {
    color: var(--muted);
    font-size: 12px;
}

.event-status {
    font-weight: 900;
    font-size: 12px;
}

.event-message {
    color: #f8fafc;
    margin-top: 6px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    padding: 28px;
    background: rgba(17,24,39,.92);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 20px 70px rgba(0,0,0,.32);
}

.login-logo {
    width: 100%;
    border-radius: 18px;
    margin-bottom: 20px;
    border: 1px solid rgba(34,197,94,.25);
}

.login-card h2 {
    font-weight: 900;
    margin: 0;
}

.login-card p {
    color: var(--muted);
}

.form-control {
    background: #0b1220;
    border-color: #243244;
    color: #fff;
}

.form-control:focus {
    background: #0b1220;
    color: #fff;
    border-color: var(--green);
    box-shadow: 0 0 0 .2rem rgba(34,197,94,.12);
}

.login-footer {
    margin-top: 20px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.skeleton {
    color: var(--muted);
}

@media (max-width: 1050px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .app-shell {
        display: block;
    }

    .content {
        margin-left: 0;
        width: 100%;
    }

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

    .topbar {
        display: grid;
        gap: 12px;
    }
}
