:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --green: #15803d;
    --green-bg: #dcfce7;
    --orange: #c2410c;
    --orange-bg: #ffedd5;
    --red: #b91c1c;
    --red-bg: #fee2e2;
    --blue-bg: #dbeafe;
    --gray-bg: #f1f5f9;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .05);
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

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

a:hover {
    text-decoration: underline;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .9em;
    background: #eef2f7;
    padding: .1em .35em;
    border-radius: 5px;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: -.02em;
    flex: 0 0 auto;
}

h1 {
    font-size: 1.15rem;
    margin: 0;
    letter-spacing: -.02em;
}

.sub {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: .85rem;
}

.topbar-actions,
.filter-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 9px 14px;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}

.btn:hover {
    background: #f8fafc;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

main {
    padding: 28px 0 40px;
}

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

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 700;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -.03em;
    margin-top: 4px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 18px;
    overflow: hidden;
}

.panel-head {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.panel-head h2 {
    font-size: 1rem;
    margin: 0;
    letter-spacing: -.01em;
}

.panel-head p {
    margin: 0;
    color: var(--muted);
    font-size: .85rem;
}

.panel-body {
    padding: 20px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

th,
td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

th {
    background: #f8fafc;
    color: var(--muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

tbody tr:hover {
    background: #f8fafc;
}

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

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.4;
    background: var(--gray-bg);
    color: #475569;
    white-space: nowrap;
}

.badge-green,
.badge-business {
    background: var(--green-bg);
    color: var(--green);
}

.badge-orange,
.badge-isp {
    background: var(--orange-bg);
    color: var(--orange);
}

.badge-hosting {
    background: #ede9fe;
    color: #6d28d9;
}

.badge-education {
    background: #cffafe;
    color: #0e7490;
}

.badge-government {
    background: #fef3c7;
    color: #92400e;
}

.badge-unknown,
.badge-gray {
    background: var(--gray-bg);
    color: #475569;
}

.badge-blue {
    background: var(--blue-bg);
    color: #1d4ed8;
}

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

.small {
    font-size: .78rem;
}

.signal {
    display: inline-block;
    margin: 4px 4px 0 0;
    padding: 1px 6px;
    border-radius: 5px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: .7rem;
    font-weight: 600;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: .9rem;
    border: 1px solid transparent;
}

.alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.sim-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sim-form input[type=text],
.sim-form input[type=password] {
    flex: 1 1 220px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: .95rem;
    font-family: inherit;
}

.sim-form input[type=text]:focus,
.sim-form input[type=password]:focus {
    outline: 2px solid #bfdbfe;
    border-color: var(--primary);
}

.topbar-actions form {
    margin: 0;
}

.login {
    max-width: 440px;
    padding-top: 12vh;
}

.snippet {
    margin: 0;
    padding: 12px 14px;
    overflow-x: auto;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    font-size: .85rem;
}

.hint {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: .82rem;
}

.empty {
    padding: 28px 20px;
    text-align: center;
    color: var(--muted);
}

.footer {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px 32px;
    color: var(--muted);
    font-size: .8rem;
}

.footer p {
    margin: 4px 0;
}

/* Demo-site */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    padding-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.site-nav {
    display: flex;
    gap: 18px;
    font-size: .9rem;
    font-weight: 600;
}

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

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

.demo-hero {
    padding: 64px 0 40px;
}

.demo-hero h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -.04em;
    margin: 0 0 16px;
    max-width: 760px;
}

.eyebrow {
    color: var(--primary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .75rem;
    margin: 0 0 12px;
}

.lead {
    color: var(--muted);
    font-size: 1.1rem;
    max-width: 680px;
    margin: 0 0 24px;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.demo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 28px 0;
}

.demo-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.demo-card h3 {
    margin: 0 0 6px;
    font-size: .95rem;
}

.demo-card p {
    margin: 0;
    color: var(--muted);
    font-size: .88rem;
}

.logged-note {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--muted);
    font-size: .88rem;
}

.demo-footer {
    border-top: 1px solid var(--border);
    margin-top: 40px;
    padding: 20px 0;
    color: var(--muted);
    font-size: .8rem;
}

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

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

    .demo-hero {
        padding-top: 40px;
    }
}

@media (max-width: 520px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .topbar-inner {
        align-items: flex-start;
    }
}
