:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --panel-2: #f8fafc;
    --text: #111827;
    --muted: #667085;
    --border: #e5e7eb;
    --primary: #16a34a;
    --primary-dark: #12823b;
    --danger: #dc2626;
    --warning: #d97706;
    --dark: #0f172a;
    --radius: 18px;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 280px; overflow-y: auto; background: #07111f; color: #fff; padding: 22px; position: fixed; inset: 0 auto 0 0; z-index: 50; display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; }
.brand-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #22c55e, #15803d); font-weight: 900; }
.brand strong { display: block; font-size: 18px; }
.brand span { color: #a7b1c2; font-size: 12px; }
.campaign-chip { padding: 14px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); border-radius: 16px; }
.campaign-chip small { display: block; color: #a7b1c2; margin-bottom: 4px; }
.campaign-chip b { font-size: 14px; line-height: 1.35; display: block; }
.campaign-chip.muted { opacity: .75; }
.nav { display: grid; gap: 8px; }
.nav a { padding: 13px 14px; color: #cbd5e1; border-radius: 13px; display: flex; justify-content: space-between; transition: .15s; }
.nav a:hover, .nav a.active { background: #16a34a; color: #fff; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding-top: 16px; color: #cbd5e1; }
.main { margin-left: 280px; width: calc(100% - 280px); padding: 28px; padding-bottom: 90px; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.topbar h1 { margin: 0; font-size: 28px; letter-spacing: -0.03em; }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.menu-btn { display: none; border: 0; background: var(--dark); color: #fff; width: 44px; height: 44px; border-radius: 12px; cursor: pointer; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: minmax(0, 1fr) minmax(330px, .45fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card h2, .card h3 { margin-top: 0; letter-spacing: -0.02em; }
.card-subtitle { color: var(--muted); margin-top: -8px; }
.stat { padding: 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow); }
.stat span { color: var(--muted); font-size: 13px; }
.stat b { display: block; font-size: 32px; margin-top: 6px; }
.form-row { display: grid; gap: 8px; margin-bottom: 14px; }
label { font-weight: 700; font-size: 14px; }
input, textarea, select { width: 100%; border: 1px solid var(--border); background: #fff; border-radius: 12px; padding: 13px 14px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.12); }
textarea { min-height: 150px; resize: vertical; }
.help { color: var(--muted); font-size: 13px; line-height: 1.5; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 15px; background: var(--dark); color: #fff; cursor: pointer; font-weight: 800; min-height: 44px; }
.btn:hover { filter: brightness(.96); }
.btn.primary { background: var(--primary); }
.btn.secondary { background: #e5e7eb; color: #111827; }
.btn.danger { background: var(--danger); }
.btn.warning { background: var(--warning); }
.btn.small { min-height: 36px; padding: 8px 10px; font-size: 13px; border-radius: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.preview-img { width: 100%; max-height: 360px; object-fit: contain; border-radius: 16px; border: 1px solid var(--border); background: #f8fafc; }
.campaign-list { display: grid; gap: 12px; }
.campaign-item { display: flex; gap: 14px; align-items: center; border: 1px solid var(--border); padding: 12px; border-radius: 14px; background: var(--panel-2); }
.campaign-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; background: #e5e7eb; flex: 0 0 auto; }
.campaign-item strong { display: block; }
.campaign-item small { color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { text-align: left; border-bottom: 1px solid var(--border); padding: 13px 12px; vertical-align: middle; }
th { background: #f8fafc; color: #475467; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #e5e7eb; color: #374151; }
.badge.sent { background: #dcfce7; color: #166534; }
.badge.pending { background: #fef3c7; color: #92400e; }
.badge.failed { background: #fee2e2; color: #991b1b; }
.badge.skipped { background: #e0e7ff; color: #3730a3; }
.alert { padding: 14px 16px; border-radius: 14px; margin-bottom: 16px; font-weight: 700; }
.alert.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert.error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at top left, rgba(34,197,94,.18), transparent 30%), #f4f7fb; }
.login-card { width: 100%; max-width: 430px; }
.overlay { display: none; }
.bottom-nav { display: none; }
.notice { border: 1px dashed #86efac; background: #f0fdf4; color: #14532d; padding: 14px; border-radius: 14px; line-height: 1.5; }
.copy-status { font-size: 13px; color: var(--muted); margin-top: 8px; }
@media (max-width: 980px) {
    .sidebar { transform: translateX(-105%); transition: .22s ease; box-shadow: 20px 0 60px rgba(0,0,0,.28); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .overlay { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 40; }
    .main { margin-left: 0; width: 100%; padding: 18px; padding-bottom: 92px; }
    .menu-btn { display: inline-grid; place-items: center; flex: 0 0 auto; }
    .topbar h1 { font-size: 22px; }
    .grid.two, .grid.three { grid-template-columns: 1fr; }
    .bottom-nav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; background: #07111f; border-radius: 18px; padding: 8px; box-shadow: 0 18px 45px rgba(15,23,42,.24); }
    .bottom-nav a { color: #cbd5e1; text-align: center; padding: 10px 4px; border-radius: 12px; font-size: 12px; font-weight: 800; }
    .bottom-nav a.active { background: var(--primary); color: #fff; }
}
@media (max-width: 640px) {
    .card { padding: 16px; }
    .actions .btn { width: 100%; }
    .campaign-item { align-items: flex-start; }
    .campaign-thumb { width: 58px; height: 58px; }
}

hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { min-width: 150px; padding: 9px 10px; }
small { color: var(--muted); }
.badge.admin { background: #dbeafe; color: #1d4ed8; }
.badge.user { background: #f3e8ff; color: #6b21a8; }
@media (max-width: 640px) { .inline-form { display: grid; } }
.danger-zone-soft { border-color: #fecaca; background: linear-gradient(180deg, #fff, #fff7f7); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
