* { box-sizing: border-box; margin: 0; }
body { font-family: -apple-system, "Segoe UI", Arial, sans-serif; background: #f4f5f7; color: #1d2129; }
.hidden { display: none !important; }
.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,.12); width: 340px; text-align: center; }
.login-box h1 { font-size: 20px; margin-bottom: 20px; }
.login-box input { width: 100%; padding: 12px; font-size: 16px; border: 1px solid #ccd0d5; border-radius: 8px; margin-bottom: 12px; }
.err { color: #c00; margin-top: 10px; font-size: 14px; min-height: 18px; }
header { display: flex; align-items: center; gap: 18px; background: #fff; padding: 12px 20px; border-bottom: 1px solid #e4e6eb; position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; }
.brand span { font-weight: 400; color: #65676b; font-size: 14px; }
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.tab { border: none; background: none; padding: 8px 14px; border-radius: 8px; font-size: 15px; cursor: pointer; color: #65676b; }
.tab.active { background: #e7f0fe; color: #0b5ed7; font-weight: 600; }
main { padding: 20px; max-width: 1200px; margin: 0 auto; }
.tabpane { display: none; }
.tabpane.active { display: block; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card h3 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.card .domain { color: #65676b; font-size: 13px; margin-bottom: 10px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.green { background: #2e9e4f; }
.dot.gray { background: #bcc0c4; }
.dot.red { background: #d9372b; }
.bigstat { font-size: 28px; font-weight: 700; }
.statline { font-size: 13px; color: #65676b; margin: 2px 0; }
.card .actions { margin-top: 12px; display: flex; gap: 8px; }
.btn { border: 1px solid #ccd0d5; background: #fff; padding: 8px 16px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.btn:hover { background: #f0f2f5; }
.btn.primary { background: #0b5ed7; border-color: #0b5ed7; color: #fff; }
.btn.primary:hover { background: #0a53be; }
.btn.big { width: 100%; padding: 12px; font-size: 16px; }
.btn.danger { background: #d9372b; border-color: #d9372b; color: #fff; }
.panel { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.panel h2 { font-size: 18px; margin-bottom: 14px; }
.row { margin-bottom: 12px; }
.row label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.row label.inline { display: inline; font-weight: 400; margin-right: 14px; }
input[type=text], input[type=password], input[type=datetime-local], textarea, select { width: 100%; padding: 9px; border: 1px solid #ccd0d5; border-radius: 8px; font-size: 14px; font-family: inherit; }
textarea { font-family: ui-monospace, monospace; font-size: 13px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { border: 1px solid #ccd0d5; border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; font-weight: 400 !important; }
.checks label:has(input:checked) { background: #e7f0fe; border-color: #0b5ed7; }
.list .item { background: #fff; border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.07); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.item .grow { flex: 1; min-width: 200px; }
.muted { color: #65676b; font-size: 13px; font-weight: 400; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.draft { background: #e4e6eb; }
.badge.scheduled { background: #fff3cd; color: #7a5d00; }
.badge.sending { background: #cfe2ff; color: #084298; }
.badge.completed { background: #d1e7dd; color: #0f5132; }
.badge.aborted { background: #f8d7da; color: #842029; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-box { background: #fff; border-radius: 12px; padding: 24px; max-width: 640px; width: 92%; max-height: 85vh; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.jobs { position: fixed; bottom: 16px; right: 16px; background: #1d2129; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 50; }
.sumgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 12px 0; font-size: 14px; }
.sumgrid div:nth-child(odd) { color: #65676b; }
.warn { background: #fff3cd; border: 1px solid #ffecb5; padding: 10px 14px; border-radius: 8px; margin: 10px 0; font-size: 14px; }
.okbox { background: #d1e7dd; border: 1px solid #badbcc; padding: 10px 14px; border-radius: 8px; margin: 10px 0; font-size: 14px; }
.preview-frame { width: 100%; height: 340px; border: 1px solid #ccd0d5; border-radius: 8px; background: #fff; }
table.mini { border-collapse: collapse; width: 100%; font-size: 13px; }
table.mini td, table.mini th { border-bottom: 1px solid #e4e6eb; padding: 5px 8px; text-align: left; }

/* mobile: tidy header on small screens */
@media (max-width: 600px) {
  header { flex-wrap: wrap; }
  header nav { display: flex; flex-wrap: wrap; gap: 4px; }
  header .brand { width: 100%; }
}
