:root {
    --bg: #0b0b0f;
    --card: #151521;
    --muted: #9ca3af;
    --text: #f5f5f5;
    --line: #2d2d3d;
    --primary: #ff2a8b;
    --primary-strong: #ff0f7a;
    --error-bg: #3a151c;
    --error-line: #7c2336;
    --success-bg: #12311f;
    --success-line: #1e5d37;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: radial-gradient(circle at top, #16162a 0%, var(--bg) 50%);
    color: var(--text);
}

body.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

body.admin-page {
    min-height: 100vh;
    padding: 24px;
}

.login-card,
.card {
    background: rgba(21, 21, 33, 0.92);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.login-card {
    width: 100%;
    max-width: 460px;
    padding: 28px;
}

.topbar {
    max-width: 1400px;
    margin: 0 auto 24px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
}

.topbar h1,
.login-card h1,
.card h2,
.result-box h3 {
    margin: 0 0 10px;
}

.brand-pill {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 42, 139, 0.12);
    color: #ff84b9;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.muted {
    color: var(--muted);
}

.dashboard-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(340px, 520px) minmax(0, 1fr);
    gap: 24px;
}

.card {
    padding: 24px;
}

.stack-lg {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    font-weight: 700;
}

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #0f0f17;
    color: var(--text);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 14px;
    outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 42, 139, 0.15);
}

textarea {
    min-height: 220px;
    resize: vertical;
    line-height: 1.5;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.field-hint {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 14px;
    padding: 13px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: white;
}

.btn.ghost {
    background: transparent;
    color: white;
    border: 1px solid var(--line);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.06);
    color: white;
    border: 1px solid var(--line);
}

.btn-sm {
    padding: 10px 13px;
    font-size: 12px;
    border-radius: 12px;
}

.btn.full {
    width: 100%;
}

.alert {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.alert ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

.alert.error {
    background: var(--error-bg);
    border: 1px solid var(--error-line);
}

.alert.success {
    background: var(--success-bg);
    border: 1px solid var(--success-line);
}

.result-box {
    margin-top: 22px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.section-divider {
    height: 1px;
    background: var(--line);
    margin: 28px 0;
}

.section-head {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.section-note {
    margin: 0;
}

.copy-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.copy-toolbar.compact {
    justify-content: flex-end;
}

.copy-feedback {
    min-height: 20px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
}

.copy-feedback[data-state="success"] {
    color: #78f1a9;
}

.copy-feedback[data-state="error"] {
    color: #ff8aa7;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.settings-mini-stats {
    margin-top: 0;
}

.stat {
    background: #11111a;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 6px;
}

.stat-compact {
    display: block;
    font-size: 12px;
    line-height: 1.5;
    word-break: break-word;
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #0f0f17;
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid #222334;
    vertical-align: top;
}

th {
    position: sticky;
    top: 0;
    background: #141426;
    z-index: 1;
}

tr:last-child td {
    border-bottom: 0;
}

.checkbox-cell {
    width: 44px;
    text-align: center;
}

.checkbox-cell input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.small {
    font-size: 13px;
    word-break: break-all;
}

.empty {
    text-align: center;
    color: var(--muted);
}

a {
    color: #ff84b9;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code {
    font-family: Consolas, Monaco, monospace;
    background: #0d0d14;
    border: 1px solid #232337;
    color: #ffd5e7;
    border-radius: 8px;
    padding: 2px 8px;
}

.tips {
    margin-top: 18px;
    line-height: 1.6;
}

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

    .topbar {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    body.admin-page,
    body.login-page {
        padding: 16px;
    }

    .card,
    .login-card {
        padding: 18px;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .copy-toolbar,
    .action-row,
    .section-head {
        align-items: stretch;
    }

    .copy-toolbar .btn,
    .action-row .btn {
        width: 100%;
    }
}
