* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #0b0f18;
    color: #e9ecf5;
}

a { color: #9cc9ff; }

.page {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 24px 32px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #0f1422;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    position: sticky;
    top: 12px;
    backdrop-filter: blur(10px);
    z-index: 5;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.logo-icon { font-size: 20px; }
.logo-text { color: #e9ecf5; }

.nav {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #c5c9d9;
    font-size: 14px;
}
.nav-item { cursor: default; }
.balance { color: #9ef6ff; }

.hero h1 {
    margin: 18px 0 8px;
    font-size: 32px;
    color: #f8f9ff;
}
.hero p {
    margin: 0 0 12px;
    color: #a9b3c5;
}

.card {
    background: #0f1422;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.35);
    margin-bottom: 18px;
}

.login-card h2,
.add-form h2 { margin-top: 0; }
.login-card {
    max-width: 420px;
    margin: 0 auto;
    text-align: center;
    padding: 24px 24px 26px;
}
.login-card .field {
    text-align: left;
}
.auth-subtitle {
    color: #9faac5;
    margin: 0 0 14px;
    font-size: 14px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid .full { grid-column: 1 / -1; }

.row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}
.filters .row { justify-content: flex-end; align-items: center; }
.filters .actions {
    flex: 0;
    display: flex;
    align-items: center;
}
.filters .actions .pill { min-width: auto; }
.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.field label {
    color: #a6afc7;
    font-size: 13px;
}

.field input,
.field textarea,
.field select {
    background: #0c111d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
    color: #e8edff;
    font-size: 14px;
}
.field input:disabled { opacity: 0.5; }
.field textarea { resize: vertical; }

.actions {
    align-self: flex-end;
}

.pill {
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}
.pill.primary {
    background: linear-gradient(90deg, #ffaa4f, #ff7a21);
    color: #0b0d1a;
}
.pill.ghost {
    background: transparent;
    color: #d6ddf3;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.pill.full { width: 100%; }

.alert {
    padding: 10px 12px;
    border-radius: 12px;
    margin: 12px 0;
    font-size: 14px;
}
.alert.success { background: rgba(46, 196, 182, 0.14); color: #8cf7ec; }
.alert.error { background: rgba(255, 99, 99, 0.12); color: #ffb4b4; }

.filters input { width: 220px; }

.table-card { padding: 0; }
.table-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.table-wrapper { overflow-x: visible; width: 100%; }
table {
    width: 100%;
    min-width: 1280px;
    border-collapse: collapse;
}
thead {
    background: #0d111d;
    color: #8ea0c7;
    font-size: 13px;
}
th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    word-break: break-word;
    white-space: normal;
    font-size: 13px;
}
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

.status {
    padding: 6px 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 12px;
}
.status.online {
    background: rgba(46, 196, 182, 0.16);
    color: #5df0d8;
}
.status.offline {
    background: rgba(255, 99, 132, 0.16);
    color: #ff99a9;
}
.status.checking {
    background: rgba(255, 189, 74, 0.16);
    color: #ffcf7a;
}

.status-col { width: 110px; }
.status-pill {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.status-pill.online {
    background: rgba(46, 196, 182, 0.16);
    color: #5df0d8;
}
.status-pill.offline {
    background: rgba(255, 99, 132, 0.16);
    color: #ff99a9;
}
.status-pill.off {
    background: rgba(180, 186, 205, 0.18);
    color: #c8cee0;
}
.countdown-cell { width: 110px; color: #d0d7f0; font-weight: 600; font-variant-numeric: tabular-nums; }
.countdown { display: inline-block; min-width: 56px; text-align: center; }

.ssl-col { width: 80px; }
.ssl-pill {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.ssl-pill.yes {
    background: rgba(46, 196, 182, 0.16);
    color: #5df0d8;
}
.ssl-pill.no {
    background: rgba(255, 99, 132, 0.16);
    color: #ff99a9;
}

.stack { display: flex; flex-direction: column; gap: 4px; }
.muted { color: #93a1c2; font-size: 13px; }

.inline-form {
    display: inline;
}
.actions-col {
    display: flex;
    gap: 8px;
    align-items: center;
}
.pill.small { padding: 7px 12px; font-size: 12px; }
.pill.danger {
    background: rgba(255, 99, 132, 0.18);
    color: #ffb4c1;
    border: 1px solid rgba(255, 99, 132, 0.35);
}
.pill.gold {
    background: linear-gradient(90deg, #ffd46a, #ffb347);
    color: #0b0d1a;
    border: 1px solid rgba(255, 212, 106, 0.6);
}
.pill.success {
    background: rgba(46, 196, 182, 0.18);
    color: #5df0d8;
    border: 1px solid rgba(46, 196, 182, 0.45);
}

.hidden { display: none; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    z-index: 50;
}
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #0f1224;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 18px 20px 12px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
    z-index: 60;
    width: min(720px, 92vw);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.close-btn {
    border: none;
    background: transparent;
    color: #dbe4ff;
    font-size: 22px;
    cursor: pointer;
}
.modal-form { margin-top: 4px; }

@media (max-width: 768px) {
    .grid, .grid-2 { grid-template-columns: 1fr; }
    .row { flex-direction: column; }
    .topbar { flex-direction: column; gap: 10px; }
    .nav { flex-wrap: wrap; justify-content: center; }
    .table-wrapper { overflow-x: auto; }
}

/* ── Checking status (background job running) ── */
.status-pill.checking {
    background: #f59e0b;
    color: #fff;
    animation: pill-pulse 1s ease-in-out infinite;
}
@keyframes pill-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}
