:root {
    --bg-1: #060816;
    --bg-2: #11162a;
    --text-main: #f3f6ff;
    --text-muted: #a3afd1;
    --line-soft: rgba(153, 167, 214, 0.26);
    --card-bg: rgba(15, 22, 45, 0.72);
    --card-bg-strong: rgba(13, 19, 38, 0.9);
    --primary: #6d7cff;
    --primary-2: #6be0ff;
    --ok-bg: rgba(14, 116, 86, 0.26);
    --ok-text: #7bf5cb;
    --fail-bg: rgba(148, 30, 67, 0.28);
    --fail-text: #ff9ebc;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(1200px 600px at 10% -5%, rgba(109, 124, 255, 0.22), transparent 55%),
        radial-gradient(900px 500px at 90% 0%, rgba(107, 224, 255, 0.16), transparent 50%),
        linear-gradient(145deg, var(--bg-1), var(--bg-2));
}

a {
    color: #90b0ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #bfd0ff;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 34px 18px 44px;
}

.page-header {
    margin-bottom: 14px;
}

.page-header h1 {
    margin: 0 0 8px;
    font-size: clamp(28px, 3vw, 38px);
    letter-spacing: 0.01em;
}

.page-header p {
    margin: 6px 0;
    color: var(--text-muted);
}

.with-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.top-actions {
    display: flex;
    gap: 10px;
}

.card {
    background: linear-gradient(145deg, var(--card-bg), var(--card-bg-strong));
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    padding: 18px;
    margin-top: 16px;
    overflow-x: auto;
    backdrop-filter: blur(8px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.card h2 {
    margin: 0 0 14px;
    font-size: 20px;
}

button,
.settings-btn {
    border: 1px solid rgba(132, 147, 201, 0.46);
    background: rgba(18, 27, 56, 0.82);
    color: var(--text-main);
    border-radius: 10px;
    padding: 9px 14px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

button:hover,
.settings-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(160, 175, 236, 0.74);
    background: rgba(28, 39, 76, 0.92);
}

.add-site-form {
    display: grid;
    gap: 12px;
    max-width: 740px;
}

.add-site-form label {
    display: grid;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    letter-spacing: 0.02em;
}

.add-site-form input,
.add-site-form textarea,
.inline-form input[type="text"],
.inline-form input[type="url"],
.inline-form select,
.add-site-form input[type="password"] {
    border: 1px solid rgba(132, 147, 201, 0.46);
    background: rgba(9, 14, 31, 0.88);
    color: var(--text-main);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    min-height: 40px;
    outline: none;
}

.add-site-form input:focus,
.add-site-form textarea:focus,
.inline-form input:focus,
.inline-form select:focus {
    border-color: var(--primary-2);
    box-shadow: 0 0 0 3px rgba(107, 224, 255, 0.2);
}

.add-site-form button {
    width: fit-content;
    background: linear-gradient(120deg, var(--primary), var(--primary-2));
    color: #0b1022;
    border: none;
}

.add-site-form button:hover {
    background: linear-gradient(120deg, #7b89ff, #8ae8ff);
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.actions-cell {
    white-space: nowrap;
}

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

.table th,
.table td {
    text-align: left;
    padding: 14px 10px;
    border-bottom: 1px solid rgba(153, 167, 214, 0.2);
    vertical-align: top;
}

.table th {
    color: #c5cff0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.table small {
    color: var(--text-muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.badge.ok {
    background: var(--ok-bg);
    color: var(--ok-text);
}

.badge.fail {
    background: var(--fail-bg);
    color: var(--fail-text);
}

.badge.paused {
    background: rgba(180, 130, 40, 0.28);
    color: #ffd98e;
}

.site-row-paused {
    opacity: 0.92;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

.status-dot.on {
    background: #3dd68c;
    box-shadow: 0 0 0 2px rgba(61, 214, 140, 0.2), 0 0 10px rgba(61, 214, 140, 0.45);
}

.status-dot.off {
    background: #ff5c7a;
    box-shadow: 0 0 0 2px rgba(255, 92, 122, 0.2), 0 0 10px rgba(255, 92, 122, 0.4);
}

.site-name-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.site-name-row a {
    font-weight: 600;
}

.site-name-row input[type="text"] {
    flex: 1;
    min-width: 0;
}

.site-edit-form {
    display: grid;
    gap: 8px;
}

.site-edit-form textarea {
    width: 100%;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.checkbox-row input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.site-note {
    margin-top: 6px;
    color: var(--text-muted);
}

button.secondary-btn,
.secondary-btn {
    background: rgba(20, 30, 59, 0.75);
}

.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.period-btn {
    background: rgba(20, 30, 59, 0.75);
}

.period-btn.active {
    background: linear-gradient(120deg, var(--primary), var(--primary-2));
    color: #0b1022;
    border-color: transparent;
}

.alert {
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 14px;
    margin-bottom: 12px;
    border: 1px solid transparent;
}

.alert.ok {
    background: var(--ok-bg);
    color: var(--ok-text);
    border-color: rgba(123, 245, 203, 0.28);
}

.alert.fail {
    background: var(--fail-bg);
    color: var(--fail-text);
    border-color: rgba(255, 158, 188, 0.25);
}

.mail-log {
    margin-top: 12px;
    border: 1px solid rgba(132, 147, 201, 0.36);
    border-radius: 10px;
    background: rgba(9, 14, 31, 0.6);
    padding: 10px 12px;
}

.mail-log small {
    color: var(--text-muted);
}

@media (max-width: 820px) {
    .with-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .top-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .card {
        border-radius: 14px;
        padding: 14px;
    }
}
