:root {
    color-scheme: light;
    --bg: #eef2f7;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-strong: #e2e8f0;
    --text: #0f172a;
    --text-muted: #475569;
    --border: rgba(15, 23, 42, 0.12);
    --primary: #2563eb;
    --primary-strong: #1d4ed8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --shadow: 0 28px 70px rgba(15, 23, 42, 0.08);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

body {
    color: var(--text);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 1.1rem 1.5rem;
    background: rgba(255,255,255,0.98);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
}

.brand {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.03em;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.95rem;
}

.site-nav a {
    color: var(--text-muted);
}

.site-nav a:hover {
    color: var(--primary);
}

.user-info {
    width: 100%;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.35rem;
}

.content {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.5rem;
}

.hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: clamp(1.75rem, 2vw, 2.5rem);
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow);
}

.hero h1 {
    margin: 0 0 0.75rem;
    font-size: clamp(2rem, 2.4vw, 3rem);
    line-height: 1.05;
}

.hero p {
    margin: 0;
    color: var(--text-muted);
    max-width: 68ch;
    font-size: 1.05rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--surface);
    border-radius: 24px;
    padding: 1.5rem;
    border: 1px solid var(--surface-strong);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.card.full-width {
    grid-column: 1 / -1;
}

.card h2 {
    margin-top: 0;
    margin-bottom: 0.9rem;
    font-size: 1.35rem;
}

.card p {
    color: var(--text-muted);
    margin-bottom: 1.3rem;
    line-height: 1.7;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.95rem 1.4rem;
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    border: none;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.button:hover {
    background: var(--primary-strong);
    transform: translateY(-1px);
}

.login-panel {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 120px);
}

.login-panel .card {
    width: min(100%, 430px);
}

label {
    display: block;
    margin: 1rem 0 0.45rem;
    font-weight: 700;
    color: var(--text);
}

input[type='text'],
input[type='password'] {
    width: 100%;
    padding: 1rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    font-size: 1rem;
    background: #ffffff;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type='text']:focus,
input[type='password']:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12);
}

.table-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.table-panel table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.table-panel th,
.table-panel td {
    padding: 1rem 1.15rem;
    text-align: left;
}

.table-panel th {
    background: var(--surface-soft);
    color: var(--text);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}

.table-panel td {
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    color: var(--text-muted);
}

.table-panel tbody tr:nth-child(even) td {
    background: #f8fbff;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
    color: #ffffff;
    min-width: 90px;
    text-align: center;
}

.status-online,
.status-ok {
    background: var(--success);
}

.status-offline,
.status-bad {
    background: var(--danger);
}

.status-warn {
    background: var(--warning);
}

.status-unknown {
    background: var(--text-muted);
}

.alert {
    border-radius: 18px;
    padding: 1.1rem 1.2rem;
    margin-bottom: 1.25rem;
    border: 1px solid #f8caca;
    background: #fff1f2;
    color: var(--danger);
}

.message.warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    padding: 1.25rem;
    border-radius: 18px;
}

.site-footer {
    text-align: center;
    padding: 1.35rem 1rem;
    color: #64748b;
    font-size: 0.95rem;
}

.small {
    margin-top: 1rem;
    color: #64748b;
    font-size: 0.95rem;
}

@media (max-width: 960px) {
    .site-header {
        justify-content: center;
    }
    .site-nav {
        justify-content: center;
    }
    .table-panel table {
        min-width: 100%;
    }
}

@media (max-width: 640px) {
    .content {
        padding: 1rem;
    }
    .hero,
    .card,
    .table-panel {
        border-radius: 20px;
    }
    .button {
        width: 100%;
    }
    .site-nav {
        width: 100%;
        justify-content: center;
    }
}
