:root {
    color-scheme: dark;
    font-family:
        "Segoe UI",
        "Microsoft YaHei",
        Arial,
        sans-serif;
    background: #111315;
    color: #e8edf2;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 20% 10%, rgba(47, 93, 102, 0.32), transparent 32%),
        linear-gradient(135deg, #111315 0%, #16191c 100%);
}

button,
input,
select {
    font: inherit;
}

button {
    border: 1px solid #38434b;
    border-radius: 7px;
    background: #1d2429;
    color: #dfe8ef;
    cursor: pointer;
    min-height: 38px;
    padding: 0 14px;
}

button:hover {
    border-color: #5f7f8c;
    background: #253039;
}

.primary {
    border-color: #3a8b8f;
    background: linear-gradient(135deg, #1e6c72, #274e74);
    color: #f7fbff;
    font-weight: 700;
}

.secondary {
    background: #20282f;
}

.danger {
    border-color: #7d3c42;
    background: #42242a;
    color: #ffd8d4;
}

.danger:hover {
    border-color: #b76068;
    background: #552d34;
}

.ghost {
    background: transparent;
}

.hidden {
    display: none !important;
}

.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 32px;
}

.auth-card {
    width: min(460px, calc(100vw - 48px));
    border: 1px solid #2d363d;
    border-radius: 10px;
    background: rgba(18, 22, 25, 0.94);
    padding: 26px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 13px;
}

.brand-row.compact {
    align-items: flex-start;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border: 1px solid #4d7c83;
    border-radius: 10px;
    object-fit: cover;
    box-shadow:
        inset 0 0 16px rgba(59, 218, 210, 0.18),
        0 0 24px rgba(24, 148, 161, 0.2);
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 22px;
}

h2 {
    font-size: 24px;
}

.brand-row p,
.content-header p,
.form-note {
    color: #91a1ad;
    font-size: 13px;
    margin-top: 4px;
}

.tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 24px 0 18px;
}

.tabs button.active {
    border-color: #4da5a8;
    color: #aaf5ef;
}

.auth-form,
.config-form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: #c8d4dc;
    font-size: 13px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #323d45;
    border-radius: 7px;
    background: #101518;
    color: #ecf3f7;
    padding: 0 11px;
}

input,
select {
    min-height: 38px;
}

textarea {
    min-height: 120px;
    padding: 10px 11px;
    resize: vertical;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-label input {
    width: 18px;
    min-height: 18px;
}

.message {
    min-height: 22px;
    margin-top: 14px;
    color: #ffd58b;
    font-size: 13px;
}

.dashboard {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 22px;
    border-right: 1px solid #283139;
    background: rgba(12, 16, 19, 0.94);
    padding: 22px;
}

nav {
    display: grid;
    gap: 9px;
}

.nav-button {
    text-align: left;
}

.nav-button.active {
    border-color: #4da5a8;
    background: #1f3539;
    color: #aaf5ef;
}

.sidebar .ghost {
    margin-top: auto;
}

.content {
    min-width: 0;
    padding: 24px;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 360px) auto;
    gap: 10px;
    margin-bottom: 14px;
}

.table-wrap {
    overflow: auto;
    border: 1px solid #2c353d;
    border-radius: 9px;
    background: rgba(15, 20, 24, 0.84);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}

th,
td {
    border-bottom: 1px solid #27313a;
    padding: 11px 12px;
    text-align: left;
    font-size: 13px;
}

th {
    color: #a8bdc9;
    background: #182027;
}

td {
    color: #e0e8ef;
}

td.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 260px;
}

.config-form {
    max-width: 760px;
    border: 1px solid #2c353d;
    border-radius: 9px;
    background: rgba(15, 20, 24, 0.84);
    padding: 18px;
}
