:root {
    color-scheme: dark;
    font-family: Segoe UI, Arial, sans-serif;
    font-size: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #111217;
    color: #eceff4;
}

a {
    color: #8ab4ff;
    text-decoration: none;
}

.container {
    width: min(1300px, calc(100% - 32px));
    margin: 0 auto;
    padding: 14px 0 20px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.logout {
    color: #ff8585;
    font-weight: 600;
}

h1 {
    margin: 0;
    font-size: 24px;
}

h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

h3 {
    margin: 12px 0 8px;
    font-size: 15px;
}

.muted {
    color: #aab0c0;
    margin: 0 0 12px;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card {
    background: #1a1d27;
    border: 1px solid #2b3040;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
}

label {
    display: block;
    color: #c7ccda;
    margin: 7px 0 4px;
    font-size: 13px;
}

input,
textarea {
    width: 100%;
    border: 1px solid #353b4d;
    background: #11131a;
    color: #f4f6fb;
    border-radius: 7px;
    padding: 6px 8px;
    font-size: 13px;
}

textarea {
    min-height: 38px;
    resize: vertical;
    font-family: Consolas, monospace;
    font-size: 11px;
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.wrap {
    flex-wrap: wrap;
}

.check {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    width: auto;
    margin: 4px 0;
}

    .check input {
        width: auto;
    }

.cols {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

button {
    border: 0;
    border-radius: 8px;
    padding: 7px 11px;
    background: #303547;
    color: white;
    cursor: pointer;
    font-size: 13px;
}

    button:hover {
        filter: brightness(1.1);
    }

    button:disabled {
        opacity: .55;
        cursor: not-allowed;
    }

    button.primary {
        background: #2563eb;
    }

    button.danger {
        background: #a33242;
        padding: 4px 8px;
    }

.status {
    margin: 8px 0 0;
    color: #9ade7b;
}

.sub-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.sub-info {
    display: grid;
    gap: 4px;
    min-height: 64px;
    padding: 10px;
    border: 1px solid #2b3040;
    border-radius: 8px;
    background: #11131a;
}

.sub-info span,
.sub-raw span {
    color: #8f98ad;
    font-size: 12px;
}

.sub-info strong {
    color: #f4f6fb;
    font-size: 15px;
    overflow-wrap: anywhere;
}

.sub-raw {
    display: grid;
    gap: 5px;
    margin-top: 8px;
}

.sub-raw code {
    overflow-wrap: anywhere;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-sort {
    background: transparent;
    padding: 0;
    color: #bfc6d8;
    font-weight: 600;
}

.table-sort:hover 
{
        filter: none;
        color: #ffffff;
}

th,
td {
    border-bottom: 1px solid #2b3040;
    padding: 6px;
    text-align: left;
    vertical-align: top;
}

th {
    color: #bfc6d8;
    font-weight: 600;
}

.ping {
    white-space: nowrap;
}

pre {
    white-space: pre-wrap;
    color: #cfd5e6;
    max-height: 220px;
    overflow: auto;
    margin: 0;
    font-size: 12px;
}

code {
    background: #11131a;
    padding: 1px 5px;
    border-radius: 5px;
}

/* Login */

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #111217;
    margin: 0;
}

.login-card 
{
    width: min(380px, calc(100vw - 32px));
    background: #1a1d27;
    border: 1px solid #2b3040;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    padding: 22px;
    display: flex;
    flex-direction: column;
    min-height: 320px;
}

.login-card h1 
{
    text-align: center;
    margin-bottom: 1px;
}

.login-text {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 3px;
    color: #aab0c0;
}

.login-card form {
    display: grid;
    gap: 8px;
}

.login-card button {
    margin-top: 10px;
}

.login-card input {
    width: 100%;
}

.error {
    background: #3a151a;
    color: #ffb4b4;
    border: 1px solid #7f1d1d;
    border-radius: 9px;
    padding: 8px 10px;
    margin: 10px 0;
}

@media (max-width: 1100px) {
    .cols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .container {
        width: calc(100% - 20px);
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .cols {
        grid-template-columns: 1fr;
    }

    .sub-info-grid {
        grid-template-columns: 1fr;
    }
}


details.card {
    padding: 0;
    overflow: hidden;
}

    details.card summary {
        list-style: none;
        cursor: pointer;
        padding: 12px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
    }

        details.card summary::-webkit-details-marker {
            display: none;
        }

        details.card summary::before {
            content: "?";
            color: #8ab4ff;
            transition: transform .15s ease;
        }

    details.card[open] summary::before {
        transform: rotate(90deg);
    }

    details.card summary span {
        font-size: 18px;
        font-weight: 600;
    }

    details.card summary small {
        color: #aab0c0;
        font-size: 12px;
        text-align: right;
    }

.card-body {
    padding: 0 12px 12px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

    .card-header h2 {
        margin: 0;
    }

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tab {
    background: #1a1d27;
    border: 1px solid #2b3040;
    color: #cfd5e6;
}

    .tab.active {
        background: #2563eb;
        border-color: #2563eb;
        color: white;
    }

.small-tabs {
    margin-bottom: 10px;
}

.log-list {
    display: grid;
    gap: 6px;
    max-height: 520px;
    overflow: auto;
}

.log-item {
    display: grid;
    grid-template-columns: 60px 70px 90px minmax(0, 1fr);
    gap: 6px;
    align-items: start;
    padding: 7px 9px;
    border: 1px solid #2b3040;
    border-radius: 8px;
    background: #11131a;
    font-size: 12px;
    overflow: hidden;
}

.log-message {
    word-break: break-word;
    overflow-wrap: anywhere;
}

@media (max-width: 700px) {

    .log-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .log-time,
    .log-level,
    .log-category {
        font-size: 11px;
    }
}

.log-time {
    color: #8f98ad;
}

.log-level {
    font-weight: 700;
}

.log-category {
    color: #8ab4ff;
}

.level-error {
    border-color: #7f1d1d;
    background: #2a1216;
}

.level-warning {
    border-color: #854d0e;
    background: #261a0b;
}

.level-info {
    border-color: #166534;
    background: #0f1f17;
}

.last-update {
    margin-top: 4px;
    font-size: 12px;
    color: #8f98ad;
}

body {
    user-select: none;
}

input,
textarea,
pre,
.log-message {
    user-select: text;
}

h1,
h2,
h3,
a,
button,
.tab {
    outline: none;
}

    h1:focus,
    h2:focus,
    h3:focus,
    a:focus,
    button:focus,
    .tab:focus {
        outline: none;
        box-shadow: none;
    }
