:root {
    color-scheme: light;
    --bg: #f4f6f8;
    --panel: #ffffff;
    --text: #15181d;
    --muted: #697180;
    --line: #dfe5ec;
    --accent: #0078ff;
    --accent-2: #00c2d8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

.shell {
    width: min(1120px, calc(100% - 32px));
    margin: 32px auto;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.topbar img,
.auth-box img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

h1,
h2,
p {
    margin: 0;
}

.topbar h1,
.auth-box h1 {
    font-size: 28px;
    line-height: 1.1;
}

.topbar p,
.panel-header span {
    color: var(--muted);
}

.tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 18px;
    overflow-x: auto;
}

.tabs a {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    background: var(--panel);
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
}

.tabs a.active {
    border-color: var(--accent);
    background: #eaf4ff;
    color: var(--accent);
}

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

.metrics article,
.panel,
.auth-box {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.metrics article {
    padding: 18px;
}

.metrics span {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
}

.metrics strong {
    font-size: 30px;
}

.panel {
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.actions form {
    display: flex;
    gap: 6px;
    margin: 0;
}

.actions button,
.actions select {
    padding: 8px 10px;
    font-size: 13px;
}

.badge {
    display: inline-block;
    border-radius: 6px;
    padding: 5px 8px;
    background: #eef2f7;
    color: var(--text);
    font-weight: 700;
}

.badge.ok {
    background: #e8f7ef;
    color: #126b38;
}

.badge.danger {
    background: #fff0f0;
    color: #9d1b1b;
}

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

.quick-grid article {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.quick-grid span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-box {
    width: min(420px, 100%);
    padding: 28px;
}

.auth-box.install {
    width: min(620px, 100%);
}

.auth-box img {
    display: block;
    margin-bottom: 14px;
}

form {
    display: grid;
    gap: 13px;
    margin-top: 20px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 14px;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
    color: var(--text);
    font: inherit;
}

button {
    border: 0;
    border-radius: 6px;
    padding: 13px 16px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: white;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.error {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #fff0f0;
    color: #9d1b1b;
}

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

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

    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }
}
