:root {
    color-scheme: light dark;
    font-family: "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}

body {
    margin: 0;
    background: #0f1419;
    color: #f5f6f8;
}

.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 48px 16px 64px;
}

.top-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(15, 20, 25, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.top-nav-links {
    max-width: 960px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

@keyframes navHoverFill {
    from {
        transform: scaleX(0);
        opacity: 0;
    }
    to {
        transform: scaleX(1);
        opacity: 1;
    }
}

.top-nav .nav-link {
    padding: 0.35rem 0.95rem;
    border-radius: 999px;
    border: 1px solid transparent;
    color: #c1d8ff;
    text-decoration: none;
    transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
    position: relative;
    overflow: hidden;
}

.top-nav .nav-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(42, 126, 255, 0.18);
    transform-origin: center;
    transform: scaleX(0);
    opacity: 0;
}

.top-nav .nav-link:hover::after {
    animation: navHoverFill 0.3s forwards;
}

.top-nav .nav-link:hover {
    color: #f5f6f8;
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-link-current::after {
    transform: scaleX(1);
    opacity: 1;
}

.nav-link {
    align-self: center;
    color: #8ab4f8;
    text-decoration: none;
}

.hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 32px;
}

.hero-nav {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.hero-nav .nav-link {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid transparent;
    color: #8ab4f8;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.hero-nav .nav-link:hover {
    border-color: #2b3b50;
    background: rgba(42, 126, 255, 0.12);
}

.hero h1 {
    margin: 0 0 0.25rem;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.hero p {
    margin: 0;
    color: #9fb0c3;
}

.card {
    background: #16202a;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    margin-bottom: 20px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

label {
    font-weight: 600;
}

.input-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.input-row input[type="text"] {
    flex: 1;
    width: auto;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #263445;
    border-radius: 10px;
    padding: 12px 14px;
    background: #0c1116;
    color: inherit;
}

button[type="submit"] {
    align-self: flex-start;
    padding: 12px 22px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(120deg, #1b78ff, #29c4ff);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

code,
.code-box,
.profile-meta dd,
.login-option p {
    font-family: "JetBrains Mono", Consolas, monospace;
}

.status {
    margin-top: 24px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-idle {
    background: #253040;
    color: #9fb0c3;
}

.badge-on,
.badge-success {
    background: #094d1b;
    color: #5cf074;
}

.badge-off,
.badge-error {
    background: #4d1c09;
    color: #ff9d74;
}

.badge-loading {
    background: #253040;
    color: #e2e8f0;
}

.profile-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 20px;
}

.profile-meta dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6f8094;
}

.profile-meta dd {
    margin: 0;
    font-size: 1.1rem;
}

.login {
    text-align: center;
}

.login-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.login-option {
    border: 1px solid #263445;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    align-items: center;
    background: #0f1720;
}

.login-option h3 {
    margin: 0;
    font-size: 1.05rem;
}

.login-option p {
    margin: 0;
    color: #9fb0c3;
    font-size: 0.95rem;
}

.login-button img {
    width: 200px;
    max-width: 45vw;
}

.muted {
    color: #9fb0c3;
}

.small {
    font-size: 0.85rem;
}

.field-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    color: #9fb0c3;
    margin: 0;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 14px;
    border: 1px solid #263445;
    border-radius: 14px;
    background: #111821;
}

.checkbox-group {
    position: relative;
}

.toggle-input {
    appearance: none;
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid #263445;
    background: #202c38;
    outline: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.toggle-input::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
}

.toggle-input:checked {
    background: linear-gradient(120deg, #1b78ff, #29c4ff);
}

.toggle-input:checked::after {
    transform: translate(18px, -50%);
}

.preview .widget {
    margin-top: 16px;
    text-align: center;
}

.preview .widget img {
    display: inline-block;
}

.link-box,
.code-box {
    margin-top: 10px;
    padding: 10px;
    background-color: #0c1116;
    border-radius: 10px;
    color: #f5f6f8;
    word-wrap: break-word;
}

.label {
    margin-top: 10px;
    font-weight: bold;
}

.code-box {
    white-space: pre-wrap;
}

.table-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

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

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

th,
td {
    padding: 0.85rem;
    border-bottom: 1px solid #263445;
    text-align: left;
}

th {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: #9fb0c3;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.table-row-selectable {
    cursor: pointer;
}

.table-row-active {
    background: rgba(41, 196, 255, 0.1);
}

.chart-card {
    margin-top: 20px;
}

.chart-wrapper {
    position: relative;
    height: 320px;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

#chartEmpty {
    text-align: center;
    margin-top: 1rem;
}

@media (max-width: 600px) {
    .input-row {
        flex-direction: column;
        align-items: stretch;
    }

    button[type="submit"] {
        width: 100%;
    }

    .hero-nav {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

