:root {
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --primary: #2563eb;
    --danger: #dc2626;
    --success: #059669;
    --warning: #d97706;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: #0f172a; color: white; padding: 24px 18px; position: fixed; inset: 0 auto 0 0; }
.brand { font-size: 24px; font-weight: 800; margin-bottom: 28px; letter-spacing: -0.02em; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar a { color: #cbd5e1; padding: 11px 12px; border-radius: 10px; }
.sidebar a:hover { background: #1e293b; color: #fff; }
.main { margin-left: 250px; width: calc(100% - 250px); padding: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.topbar h1 { margin: 0; font-size: 28px; }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.userbox { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; margin-bottom: 20px; box-shadow: 0 8px 24px rgba(15, 23, 42, .04); }
.grid { display: grid; gap: 16px; margin-bottom: 20px; }
.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric span { color: var(--muted); display: block; margin-bottom: 8px; }
.metric strong { font-size: 32px; }
.alert { padding: 13px 15px; border-radius: 12px; margin: 0 0 16px; border: 1px solid transparent; }
.alert.success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert.danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.status-list { display: grid; gap: 9px; margin: 12px 0 18px; }
.inline-actions, .search-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
button, .button-lite { background: var(--primary); border: 0; color: white; padding: 11px 15px; border-radius: 10px; font-weight: 700; cursor: pointer; display: inline-block; }
.button-lite { background: #e0ecff; color: #1d4ed8; }
.danger-btn { background: var(--danger); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #eef2ff; color: #3730a3; }
.badge.completed { background: #ecfdf5; color: #047857; }
.badge.failed { background: #fef2f2; color: #b91c1c; }
.badge.processing, .badge.queued { background: #fffbeb; color: #b45309; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 11px; max-width: 980px; }
.form-grid h2 { margin: 10px 0 4px; }
label { font-weight: 750; }
label small { display: block; color: var(--muted); font-weight: 500; margin-top: 2px; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: white; color: var(--text); font: inherit; }
textarea { resize: vertical; }
.small-form { max-width: 620px; }
.preview-box { background: #f8fafc; border: 1px dashed #cbd5e1; padding: 14px; border-radius: 12px; }
.telegram-preview { margin-top: 10px; display: flex; gap: 8px; }
.telegram-preview span { display: inline-flex; padding: 9px 12px; background: #dbeafe; border-radius: 9px; color: #1e40af; font-weight: 700; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; background: #f8fafc; border-radius: 12px; padding: 14px; margin: 14px 0; }
.log-box { white-space: pre-wrap; word-break: break-word; background: #0f172a; color: #e2e8f0; border-radius: 14px; padding: 16px; max-height: 520px; overflow: auto; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #dbeafe, #f8fafc 55%, #ecfdf5); }
.login-card { width: 100%; max-width: 430px; background: white; border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: 0 22px 70px rgba(15,23,42,.12); }
.login-card.wide { max-width: 620px; }
.login-card h1 { margin-top: 0; }
.login-card form { display: grid; gap: 12px; }
@media (max-width: 900px) {
    .sidebar { position: static; width: 100%; }
    .layout { display: block; }
    .main { width: 100%; margin-left: 0; padding: 18px; }
    .cards-4, .detail-grid { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; gap: 12px; flex-direction: column; }
}
.badge.owner { background: #fef3c7; color: #92400e; }
.badge.admin { background: #e0f2fe; color: #075985; }
.badge.user { background: #f1f5f9; color: #475569; }
.badge.sending, .badge.queued, .badge.pending { background: #fffbeb; color: #b45309; }
.badge.sent { background: #ecfdf5; color: #047857; }
.badge.blocked { background: #fef2f2; color: #b91c1c; }
.muted { color: var(--muted); }
.checkbox-line { display: flex; gap: 8px; align-items: center; font-weight: 650; }
.checkbox-line input { width: auto; }
.mini-form { gap: 6px; }
.mini-form button { padding: 8px 10px; font-size: 12px; }
.preview-box pre { white-space: pre-wrap; word-break: break-word; margin: 0; }

.muted{color:#6b7280;font-size:14px;line-height:1.5}.form-grid code{background:#f3f4f6;border:1px solid #e5e7eb;border-radius:6px;padding:2px 6px}.form-grid input[type=file]{padding:10px;background:#fff;border:1px dashed #cbd5e1;border-radius:10px}
/* Required ads / premium panel refinements */
.sidebar .brand { background: linear-gradient(135deg,#ffffff,#93c5fd); -webkit-background-clip:text; background-clip:text; color:transparent; }
.card h2 { letter-spacing:-.02em; }
.inline-actions form { display:inline-block; margin:0; }
.mini-form { display:inline-block; }
.card.metric { position:relative; overflow:hidden; }
.card.metric:after { content:""; position:absolute; right:-30px; top:-30px; width:90px; height:90px; border-radius:50%; background:rgba(37,99,235,.08); }
pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
