:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --danger: #dc2626;
  --success: #16a34a;
  --border: #e5e7eb;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
.container { max-width: 1280px; margin: 0 auto; padding: 20px; }
.navbar { background: #111827; color: #fff; }
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.nav-links { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.nav-links a { color: #e5e7eb; }
.brand { font-size: 20px; font-weight: 700; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: 0 6px 22px rgba(15, 23, 42, 0.04); margin-bottom: 18px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.grid-6 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
h1, h2, h3 { margin-top: 0; }
label { font-weight: 600; display: block; margin-bottom: 8px; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="date"], input[type="datetime-local"], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: #fff;
}
input[type="file"] { width: 100%; }
textarea { min-height: 140px; resize: vertical; }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 10px;
  border: none; background: var(--primary); color: white; cursor: pointer; font-weight: 600;
}
.btn-secondary { background: #475569; }
.btn-danger { background: var(--danger); }
.btn-light { background: #e5e7eb; color: #111827; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-draft { background: #e5e7eb; color: #111827; }
.badge-scheduled { background: #dbeafe; color: #1d4ed8; }
.badge-running { background: #fef3c7; color: #b45309; }
.badge-paused { background: #ede9fe; color: #6d28d9; }
.badge-pending { background: #dbeafe; color: #1d4ed8; }
.badge-sent, .badge-completed { background: #dcfce7; color: #166534; }
.badge-failed, .badge-completed_with_errors { background: #fee2e2; color: #991b1b; }
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; }
.flash-success { background: #dcfce7; color: #166534; }
.flash-danger { background: #fee2e2; color: #991b1b; }
.flash-info { background: #dbeafe; color: #1d4ed8; }
.small { color: var(--muted); font-size: 13px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.variable-palette { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }
.variable-pill { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 420px; }
pre.code { background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
pre.code-light { background: #f8fafc; color: #0f172a; padding: 12px; border-radius: 12px; border: 1px solid var(--border); overflow-x: auto; white-space: pre-wrap; word-break: break-word; min-height: 48px; }
.preview-pane { min-height: 140px; border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: #fff; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stat { font-size: 32px; font-weight: 700; }
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; }
.mapping-row { align-items: stretch; }
.mapping-row .btn { align-self: stretch; }
.metric-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.metric-row:last-child { border-bottom: none; }
.chart-row { display: grid; grid-template-columns: 110px 1fr 50px; gap: 10px; align-items: center; margin-bottom: 10px; }
.chart-label, .chart-value { font-size: 13px; color: var(--muted); }
.chart-bar, .mini-chart { width: 100%; height: 12px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.chart-bar span, .mini-chart span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.mini-chart { max-width: 220px; margin-bottom: 6px; }
.mini-chart-danger span { background: var(--danger); }
.pagination { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.attachment-list { display: flex; gap: 8px; flex-wrap: wrap; }
.attachment-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 999px; background: #f8fafc; border: 1px solid var(--border); }
.attachment-chip input { width: auto; }
.attachment-chip-removable { background: #fff7ed; }
@media (max-width: 760px) {
  .container { padding: 16px; }
  .toolbar input, .toolbar select { width: 100%; min-width: 0; }
}
.badge-archived { background: #e0e7ff; color: #3730a3; }
.rich-toolbar { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.rich-toolbar button { padding: 8px 12px; border-radius: 8px; background: #e5e7eb; color:#111827; }
.rich-editor { min-height: 280px; border:1px solid var(--border); border-radius: 12px; padding: 12px; background:#fff; overflow:auto; }
.rich-editor:focus { outline: 2px solid #bfdbfe; border-color:#93c5fd; }
.rich-editor.small-editor { min-height: 220px; }
.subtle-box { background:#f8fafc; border:1px solid var(--border); border-radius:12px; padding:12px; }
.list-inline { display:flex; gap:8px; flex-wrap:wrap; }
