:root {
    --bg: #0f1419;
    --surface: #1a2332;
    --border: #2d3a4f;
    --text: #e7ecf3;
    --muted: #8b9cb3;
    --primary: #3b82f6;
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.brand { font-weight: 700; font-size: 1.1rem; }
.topbar-meta { display: flex; align-items: center; gap: 1rem; }

.panel { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.muted { color: var(--muted); font-size: 0.9rem; }

.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.auth-card { width: 100%; max-width: 400px; }

.form label { display: block; margin: 0.75rem 0 0.25rem; font-size: 0.85rem; }
.form input, .form textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
}
.form-inline { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-grid label { grid-column: span 1; }
.form-grid input { grid-column: span 1; }
.form-grid .btn { grid-column: 1 / -1; margin-top: 0.5rem; }

.btn {
    display: inline-block;
    padding: 0.55rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #fff;
    background: var(--primary);
}
.btn-primary { background: var(--primary); }
.btn-success { background: var(--success); }
.btn-warning { background: var(--warning); color: #111; }
.btn-danger { background: var(--danger); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn:hover { opacity: 0.9; }

.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.alert-error { background: rgba(239,68,68,0.15); border: 1px solid var(--danger); }
.alert-success { background: rgba(34,197,94,0.15); border: 1px solid var(--success); }

.badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--border);
}
.badge-successful { background: rgba(34,197,94,0.25); }
.badge-not_answered { background: rgba(234,179,8,0.25); }
.badge-troll { background: rgba(239,68,68,0.25); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.stat-label { display: block; font-size: 0.8rem; color: var(--muted); }
.stat-value { font-size: 1.75rem; font-weight: 700; }
.stat-success { color: var(--success); }
.stat-danger { color: var(--danger); }

.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--border); }

.code-block {
    display: block;
    background: var(--bg);
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    overflow-x: auto;
    margin: 0.5rem 0;
}

.status-dot { color: var(--success); font-weight: 600; }

.popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}
.popup.hidden { display: none; }
.popup-inner { width: 100%; max-width: 480px; }
.phone-display { font-size: 1.5rem; font-weight: 700; margin: 0.5rem 0 1rem; }
.contact-block dl { margin: 0; }
.contact-block dt { color: var(--muted); font-size: 0.8rem; margin-top: 0.5rem; }
.contact-block dd { margin: 0.15rem 0 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
