* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    background: radial-gradient(circle at top right, #1f2b4a 0, #0b0f1c 48%);
    color: #eef2ff;
}

.wrap {
    width: min(1100px, 94vw);
    margin: 0 auto;
    padding: 22px 0 40px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.title {
    font-size: clamp(1.3rem, 4vw, 2rem);
    margin: 0;
}

.muted {
    color: #aab3cc;
}

.card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 16px;
}

.grid {
    display: grid;
    gap: 14px;
}

.grid.cols-4 {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.grid.cols-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.kpi h2 {
    margin: 0 0 6px;
    font-size: 1.6rem;
}

.kpi p {
    margin: 0;
    color: #acb6d3;
}

.btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: #f2f5ff;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

.btn.primary {
    background: linear-gradient(120deg, #ff6d2d, #ff8d4f);
    border-color: transparent;
    color: #1f1308;
}

.btn.danger {
    background: linear-gradient(120deg, #ff5d68, #f8826f);
    border-color: transparent;
    color: #2d0c11;
}

.btn.small {
    font-size: .82rem;
    padding: 7px 10px;
}

form {
    margin: 0;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: .9rem;
}

input {
    width: 100%;
    padding: 10px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    margin-bottom: 10px;
}

select,
textarea {
    width: 100%;
    padding: 10px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    margin-bottom: 10px;
    font-family: inherit;
}

select option {
    color: #121212;
    background: #ffffff;
}

.client-form .btn.primary {
    margin-top: 4px;
}

.msg {
    margin: 0 0 14px;
    padding: 10px;
    border-radius: 10px;
}

.msg.ok {
    background: rgba(32, 180, 125, 0.18);
    border: 1px solid rgba(32, 180, 125, 0.5);
}

.msg.err {
    background: rgba(255, 83, 96, 0.15);
    border: 1px solid rgba(255, 83, 96, 0.55);
}

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

th, td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
}

th {
    color: #c5ceea;
    font-weight: 700;
}

.badge {
    border-radius: 999px;
    padding: 3px 9px;
    font-size: .78rem;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.23);
}

.ok {
    color: #7ef0ba;
}

.warn {
    color: #ffc77d;
}

.tutorial-list li {
    margin-bottom: 10px;
}

.tutorial-list ul {
    margin-top: 8px;
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.tab-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
    color: #dfe7fb;
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
}

.tab-btn.active {
    background: linear-gradient(120deg, #ff6d2d, #ff8d4f);
    color: #1f1308;
    border-color: transparent;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.support-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.support-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.support-btn svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.device-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.device-btn {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f4f6ff;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.device-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 141, 79, 0.9);
    background: linear-gradient(160deg, rgba(255, 141, 79, 0.22), rgba(255, 141, 79, 0.08));
}

.device-btn svg {
    width: 20px;
    height: 20px;
}

.downloader-code {
    margin-top: 8px;
    font-size: .84rem;
}
