:root {
    --bg: #eef5f8;
    --panel: #ffffff;
    --ink: #162033;
    --muted: #6b788d;
    --line: #d9e3ea;
    --primary: #0f766e;
    --primary-2: #115e59;
    --danger: #b42318;
    --ok: #12805c;
    --warn: #8a5a00;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Tahoma, Arial, sans-serif;
    font-size: 14px;
}
a { color: inherit; text-decoration: none; }
.topbar, .console-bar {
    height: 52px;
    background: #152235;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 3px solid #18a3c7;
}
.topbar strong { font-size: 16px; }
.topbar span { color: #b8c7d9; margin-inline-start: 12px; }
.topbar nav, .console-bar div { display: flex; gap: 10px; align-items: center; }
.topbar a, .console-bar a {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
}
.topbar a.soft,
.console-bar a.soft {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.22);
    color: #fff;
}
.topbar a:hover,
.console-bar a:hover {
    background: rgba(255,255,255,.2);
}
.shell { padding: 18px; max-width: 1500px; margin: 0 auto; }
.toolbar {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 14px;
    margin-bottom: 14px;
}
.toolbar form { display: flex; gap: 8px; align-items: center; }
input {
    height: 38px;
    border: 1px solid #cbd6df;
    border-radius: 5px;
    padding: 0 10px;
    min-width: 280px;
}
button, .primary, .soft {
    height: 38px;
    border: 0;
    border-radius: 5px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
button, .primary { background: var(--primary); color: #fff; }
button:hover, .primary:hover { background: var(--primary-2); }
.soft { background: #eef3f6; color: #223047; border: 1px solid #d5e0e7; }
.soft-button {
    background: #eef3f6;
    color: #223047;
    border: 1px solid #d5e0e7;
}
.toolbar p { color: var(--muted); margin: 10px 0 0; }
.table-wrap {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 12px;
    overflow: hidden;
}
.table-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.status-filter {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: #eef3f6;
    border: 1px solid var(--line);
    border-radius: 7px;
}
.status-filter button {
    height: 30px;
    background: transparent;
    color: #41516a;
    border-radius: 5px;
    padding: 0 12px;
}
.status-filter button.active {
    background: var(--primary);
    color: #fff;
}
.status-summary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.status-summary span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
}
.status-summary strong {
    color: var(--ink);
}
.servers-table {
    width: 100%;
    min-width: 1120px;
    border-collapse: collapse;
}
.servers-table th,
.servers-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    vertical-align: middle;
    white-space: nowrap;
}
.servers-table th {
    background: #f4f8fb;
    color: #41516a;
    font-weight: 700;
}
.servers-table tbody tr:nth-child(even) { background: #fbfdfe; }
.servers-table tbody tr:hover { background: #eef7f9; }
.server-name {
    min-width: 210px;
    max-width: 320px;
    white-space: normal;
    font-weight: 700;
}
.row-actions {
    display: flex;
    gap: 6px;
    min-width: 190px;
}
.row-actions .primary,
.row-actions .soft {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
}
.dataTables_wrapper {
    direction: rtl;
    color: var(--ink);
}
.dt-top,
.dt-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.dt-top { margin-bottom: 12px; }
.dt-bottom { margin-top: 12px; }
.dataTables_length,
.dataTables_filter,
.dataTables_info,
.dataTables_paginate {
    float: none !important;
    margin: 0 !important;
    color: var(--muted) !important;
}
.dataTables_filter label,
.dataTables_length label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.dataTables_filter input,
.dataTables_length select {
    height: 34px;
    border: 1px solid #cbd6df;
    border-radius: 5px;
    background: #fff;
    color: var(--ink);
}
.dataTables_filter input {
    min-width: 280px;
    margin: 0 !important;
    padding: 0 10px;
}
.dataTables_length select {
    min-width: 74px;
    padding: 0 8px;
}
.dataTables_scroll {
    border: 1px solid var(--line);
}
.dataTables_scrollHead {
    background: #f4f8fb;
}
table.dataTable.no-footer,
table.dataTable thead th,
table.dataTable thead td {
    border-bottom: 1px solid var(--line) !important;
}
table.dataTable tbody th,
table.dataTable tbody td {
    padding: 9px 10px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid var(--line) !important;
    border-radius: 5px !important;
    background: #fff !important;
    color: var(--ink) !important;
    margin: 0 2px !important;
    padding: 5px 10px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #eef7f9 !important;
    border-color: #c8dce3 !important;
    color: var(--ink) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    color: #9aa8b8 !important;
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}
.server-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 14px;
}
.card-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
    margin-bottom: 10px;
}
h1, h2 { margin: 0; }
h2 { font-size: 15px; line-height: 1.5; }
.status {
    min-width: 72px;
    text-align: center;
    border-radius: 999px;
    font-size: 12px;
    padding: 4px 8px;
    background: #eef3f6;
    color: var(--muted);
}
.status.online { background: #dff7ed; color: var(--ok); }
.status.offline { background: #ffe6e2; color: var(--danger); }
.status.pending { background: #fff2cc; color: var(--warn); }
dl {
    display: grid;
    grid-template-columns: 94px 1fr;
    gap: 8px;
    margin: 0 0 12px;
}
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.actions { display: flex; gap: 8px; }
.actions a { flex: 1; }
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}
.login-card {
    width: min(420px, calc(100vw - 28px));
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(20, 35, 55, .12);
}
.brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    margin-bottom: 14px;
}
.login-card h1 { font-size: 22px; }
.login-card p { color: var(--muted); margin: 8px 0 20px; }
.login-card label { display: block; margin: 12px 0 6px; color: var(--muted); }
.login-card input, .login-card button { width: 100%; min-width: 0; }
.alert {
    background: #ffe6e2;
    color: var(--danger);
    border: 1px solid #ffc7bd;
    border-radius: 6px;
    padding: 10px;
}
.alert.success {
    background: #dff7ed;
    color: var(--ok);
    border-color: #b8ead5;
}
.full-link {
    width: 100%;
    margin-top: 10px;
}
.settings-shell {
    max-width: 850px;
}
.settings-card {
    background: #fff;
    border: 1px solid var(--line);
    padding: 18px;
}
.settings-card h1 {
    font-size: 20px;
    margin: 0 0 16px;
}
.settings-card label:not(.check-row) {
    display: block;
    color: var(--muted);
    margin: 14px 0 6px;
}
.settings-card input[type="text"],
.settings-card input:not([type]) {
    width: 100%;
    min-width: 0;
}
.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
}
.check-row input {
    width: 18px;
    height: 18px;
    min-width: 18px;
}
.settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}
.settings-actions.compact {
    margin-top: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
}
.link-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: #f4f8fb;
    border: 1px solid var(--line);
    padding: 14px;
    margin: 16px 0;
}
.link-box p {
    margin: 6px 0 0;
    color: var(--muted);
}
.connect-code {
    display: inline-flex;
    margin-top: 10px;
    padding: 8px 14px;
    border-radius: 6px;
    background: #fff;
    border: 1px dashed #9bb3c2;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--primary-2);
}
pre {
    background: #101827;
    color: #d8e5f4;
    border-radius: 7px;
    padding: 14px;
    overflow: auto;
}
.console-page { height: 100vh; overflow: hidden; }
.console-bar { height: 46px; border-bottom: 0; }
iframe {
    width: 100%;
    height: calc(100vh - 46px);
    border: 0;
    display: block;
    background: #111;
}
@media (max-width: 700px) {
    .topbar { height: auto; padding: 12px; align-items: flex-start; gap: 12px; }
    .topbar, .toolbar form, .actions { flex-direction: column; }
    input, button, .primary, .soft { width: 100%; min-width: 0; }
    .shell { padding: 10px; }
    .row-actions .primary,
    .row-actions .soft { width: auto; }
    .link-box,
    .settings-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
