:root {
  --bg: #f4f5f7; --card: #fff; --text: #1d2129; --muted: #6b7280; --line: #e3e5e8;
  --accent: #1f6feb; --accent-dark: #1858c4; --ok: #1a7f37; --warn: #b54708; --bad: #c62828;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { background: #eef0f3; padding: 1px 5px; border-radius: 4px; word-break: break-all; }
h1 { font-size: 24px; margin: 6px 0 16px; }
h2 { font-size: 17px; margin: 0 0 12px; }

.top { display: flex; align-items: center; gap: 24px; padding: 10px 24px; background: #111827; color: #fff; flex-wrap: wrap; }
.top .brand { color: #fff; font-weight: 700; font-size: 16px; }
.top .brand small { color: #9ca3af; font-weight: 400; }
.top nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.top nav a { color: #d1d5db; padding: 6px 10px; border-radius: 6px; }
.top nav a:hover, .top nav a.on { background: #374151; color: #fff; text-decoration: none; }
.top .logout button { color: #d1d5db; }

main { max-width: 1180px; margin: 0 auto; padding: 20px 24px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.card.danger { border-color: #f5c2c0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.split > .card { margin-bottom: 0; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
table.kv th { width: 34%; }
td.actions { white-space: nowrap; }
td.actions a { margin-right: 10px; }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; border: 0; padding: 0; margin: 0; }
.field > span, .field > legend { font-weight: 600; font-size: 14px; }
fieldset.field { border-top: 1px solid var(--line); padding-top: 12px; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #cfd4da; border-radius: 7px; background: #fff; width: 100%; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9ec5ff; border-color: var(--accent); }
.field.bad input, .field.bad select, .field.bad textarea { border-color: var(--bad); }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin-right: 16px; }
.check input { width: auto; }
details > summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inline input { width: auto; }
input.short { width: 120px; }

button, .button { display: inline-block; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 7px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: var(--accent-dark); text-decoration: none; }
button.secondary, .button.secondary { background: #fff; color: var(--accent); }
button.secondary:hover, .button.secondary:hover { background: #eef4ff; }
button.danger { background: var(--bad); border-color: var(--bad); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 400; }
button.small { padding: 4px 10px; font-size: 13px; }
button.link.small { padding: 0; }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.hint { color: var(--muted); font-size: 13px; font-weight: 400; }
.muted { color: var(--muted); }
.err { color: var(--bad); font-size: 13px; margin: 0; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
p.warn { background: #fff7ed; border: 1px solid #fed7aa; padding: 10px 12px; border-radius: 8px; }
.notice { background: #ecfdf3; border: 1px solid #abefc6; color: #05603a; padding: 10px 14px; border-radius: 8px; }
.crumbs { margin: 0 0 4px; font-size: 14px; }
.stats, .switch { color: var(--muted); }
.tag { background: #eef4ff; color: var(--accent); border-radius: 4px; padding: 0 6px; font-size: 12px; }
pre.code { background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 8px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #eef0f3; color: #374151; }
.badge.sent { background: #dcfce7; color: #166534; }
.badge.partial { background: #fef3c7; color: #92400e; }
.badge.failed { background: #fee2e2; color: #991b1b; }
.badge.scheduled { background: #dbeafe; color: #1e40af; }
.badge.canceled { background: #f3f4f6; color: #6b7280; }

.phone { background: linear-gradient(160deg, #3b4252, #1f2430); border-radius: 18px; padding: 18px 12px; }
.notif { background: rgba(255, 255, 255, .96); border-radius: 14px; padding: 10px 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.notif-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #4b5563; }
.notif-icon { width: 16px; height: 16px; border-radius: 50%; background: #ffc233; }
.notif-time::before { content: "· "; }
.notif-title { font-weight: 700; margin-top: 4px; overflow-wrap: anywhere; }
.notif-body { font-size: 14px; color: #374151; white-space: pre-line; overflow-wrap: anywhere; }
.notif-image { display: block; width: 100%; margin-top: 8px; border-radius: 8px; max-height: 180px; object-fit: cover; }
.notif-image[hidden] { display: none; }
.counter { color: var(--muted); font-size: 12px; text-align: right; }
.login button { width: 100%; margin-top: 8px; }
[hidden] { display: none !important; }
.card { overflow-x: auto; }
@media (max-width: 600px) { main { padding: 14px 12px 40px; } .top { padding: 10px 12px; gap: 10px; } th, td { padding: 6px 8px; } }
