:root {
    --bg: #050510;
    --bg-soft: #111322;
    --bg-card: #16182a;
    --accent: #4f46e5;
    --accent-soft: rgba(79, 70, 229, 0.1);
    --accent-danger: #ef4444;
    --text: #f9fafb;
    --text-muted: #9ca3af;
    --border: #1f2933;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.45);
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Global */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text);
    background: radial-gradient(circle at top, #111827 0, #020617 45%, #020617 100%);
}

/* Utility */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #f9fafb, #22c55e 40%, #16a34a 80%);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.9);
}

.brand-name {
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.8);
    color: var(--text);
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    gap: 6px;
}

.btn:hover {
    background: rgba(30, 64, 175, 0.8);
    border-color: rgba(129, 140, 248, 0.9);
}

.btn.small {
    padding: 4px 10px;
    font-size: 12px;
}

.btn.ghost {
    background: transparent;
}

.btn.danger {
    border-color: rgba(248, 113, 113, 0.8);
}

.primary-btn {
    background: var(--accent);
    border-color: transparent;
}

.primary-btn:hover {
    background: #4338ca;
}

.full-width {
    width: 100%;
}

/* Header */
.site-header {
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
    background: linear-gradient(to right, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.96));
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.site-stats {
    font-size: 13px;
    color: var(--text-muted);
}

/* Layout */
.layout {
    display: flex;
    gap: 16px;
    max-width: 1200px;
    margin: 16px auto 32px;
    padding: 0 16px;
}

/* Sidebar */
.sidebar {
    flex: 0 0 160px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 12px;
    box-shadow: var(--shadow-soft);
}

.sidebar-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.filter-btn {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
}

.filter-btn.active {
    color: var(--text);
    border-color: rgba(129, 140, 248, 0.9);
    background: var(--accent-soft);
}

.filter-btn:hover {
    border-color: rgba(148, 163, 184, 0.7);
}

/* Content */
.content {
    flex: 1;
    background: rgba(15, 23, 42, 0.9);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    padding: 10px 12px 16px;
    box-shadow: var(--shadow-soft);
    min-width: 0;
}

/* Site list header */
.site-list-header {
    display: grid;
    grid-template-columns: 2.4fr 0.7fr 1fr 1fr 1.4fr;
    gap: 8px;
    padding: 6px 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

/* Site rows */
.site-list {
    margin-top: 4px;
}

.site-row {
    display: grid;
    grid-template-columns: 2.4fr 0.7fr 1fr 1fr 1.4fr;
    gap: 8px;
    padding: 10px 8px;
    align-items: center;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.site-row:nth-child(odd) {
    background: rgba(15, 23, 42, 0.7);
}

.site-row:nth-child(even) {
    background: rgba(15, 23, 42, 0.9);
}

.site-row:hover {
    border-color: rgba(129, 140, 248, 0.6);
    background: radial-gradient(circle at top left, rgba(79, 70, 229, 0.12), rgba(15, 23, 42, 0.96));
    transform: translateY(-1px);
}

.site-main {
    display: flex;
    flex-direction: column;
}

.site-domain {
    font-size: 14px;
    font-weight: 500;
}

.site-name {
    font-size: 12px;
    color: var(--text-muted);
}

.site-country,
.site-niche,
.site-status,
.site-actions {
    font-size: 13px;
}

.site-country {
    color: var(--text-muted);
}

.site-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.site-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Status dots */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    box-shadow: 0 0 8px rgba(148, 163, 184, 0.8);
}

.status-unknown {
    background: #6b7280;
}

.status-ok {
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.9);
}

.status-bad {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.9);
}

.status-ms {
    font-size: 12px;
    color: var(--text-muted);
}

/* Login page */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 16px;
}

.login-card {
    background: rgba(15, 23, 42, 0.95);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    padding: 24px 22px 22px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.login-title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
}

.login-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.login-form label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}

.login-form input {
    width: 100%;
    border-radius: 999px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: rgba(15, 23, 42, 0.9);
    color: var(--text);
    padding: 7px 11px;
    font-size: 14px;
    outline: none;
    margin-bottom: 10px;
}

.login-form input:focus {
    border-color: rgba(129, 140, 248, 0.9);
    box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.8);
}

.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.7);
    color: #fecaca;
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 10px;
    margin-bottom: 12px;
}

/* Responsive */
@media (max-width: 900px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
    }

    .sidebar-title {
        width: 100%;
        margin-bottom: 4px;
    }

    .filter-btn {
        flex: 1 1 80px;
        text-align: center;
    }

    .site-list-header {
        display: none;
    }

    .site-row {
        grid-template-columns: 1.6fr 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "main status"
            "country niche"
            "actions actions";
    }

    .site-main {
        grid-area: main;
    }

    .site-country {
        grid-area: country;
    }

    .site-niche {
        grid-area: niche;
    }

    .site-status {
        grid-area: status;
        justify-content: flex-end;
    }

    .site-actions {
        grid-area: actions;
    }
}
