:root {
  --green: #157a4b;
  --green-dark: #0f5c38;
  --green-soft: #d8f0e2;
  --green-text: #0d6b42;
  --bg: #eef3ef;
  --drawer: #f4f7f5;
  --card: #ffffff;
  --line: #dce6df;
  --text: #122017;
  --muted: #6b7a72;
  --danger: #c0392b;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Manrope, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-card { width: min(400px, 100%); background: var(--card); border-radius: 16px; padding: 36px 32px; box-shadow: 0 8px 32px #00000014; }
.login-mark { font-weight: 800; color: var(--green-dark); letter-spacing: .04em; }
.login-card h1 { margin: 8px 0 6px; font-size: 32px; }
.login-card p { margin: 0 0 22px; color: var(--muted); }
.hint { color: var(--muted); }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card label, .panel label { display: block; font-size: 13px; color: var(--muted); }
.login-card label { margin: 0; }
.panel label { margin-top: 14px; }
input, button, textarea { font: inherit; }
input, textarea { width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); }
button { cursor: pointer; }
.login-card button { width: 100%; margin-top: 8px; border: 0; border-radius: 10px; padding: 13px 18px; background: var(--green-dark); color: #fff; font-weight: 800; }
#saveBtn, #notifNewBtn, #notifSendBtn { border: 0; border-radius: 10px; padding: 12px 18px; background: var(--green-dark); color: #fff; font-weight: 800; }
.error { background: #fdecea; color: var(--danger); padding: 10px 12px; border-radius: 10px; margin-top: 12px; }
.topbar { position: sticky; top: 0; z-index: 30; height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; background: linear-gradient(90deg, var(--green-dark), #16824f); color: #fff; }
.topbar-brand { font-weight: 800; letter-spacing: .04em; }
.topbar-user { font-size: 14px; }
.topbar-user a { margin-left: 14px; color: #fff; text-decoration: underline; }
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 56px); }
.drawer { background: var(--drawer); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-btn { text-align: left; border: 0; background: transparent; color: #3d4a43; padding: 11px 14px; border-radius: 10px; font-weight: 700; font-size: 15px; }
.nav-btn:hover { background: #e7eee9; }
.nav-btn.active { background: var(--green-soft); color: var(--green-text); }
.main { padding: 28px 32px 64px; }
.kicker { margin: 0; font-size: 12px; letter-spacing: .12em; font-weight: 800; color: var(--green); }
.page-h { margin: 4px 0 22px; font-size: 34px; }
.page { display: none; }
.page.active { display: block; }
.stat { background: var(--card); border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 0 #0000000d; }
.stat span { display: block; color: var(--muted); font-size: 13px; }
.stat strong { display: block; margin-top: 10px; font-size: 32px; font-weight: 800; }
.ads-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.cohort-tabs {
  display: inline-flex;
  gap: 4px;
  margin: 0 0 18px;
  padding: 4px;
  border-radius: 12px;
  background: #e7eee9;
  width: fit-content;
}
.cohort-tab {
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  font-size: 15px;
  padding: 10px 22px;
  border-radius: 10px;
  min-width: 120px;
}
.cohort-tab.active {
  background: var(--green-dark);
  color: #fff;
}
.panel { background: var(--card); border-radius: 14px; padding: 22px; margin-bottom: 16px; box-shadow: 0 1px 0 #0000000d; }
.panel h2 { margin: 0 0 10px; font-size: 18px; }
.panel h3 { margin: 16px 0 8px; font-size: 13px; color: var(--green-text); }
.row { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.panel .switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.panel .switch span { flex: 1; min-width: 0; line-height: 1.4; }
.panel .switch input {
  appearance: none;
  -webkit-appearance: none;
  width: 46px;
  min-width: 46px;
  max-width: 46px;
  height: 28px;
  margin: 0;
  padding: 0;
  flex: 0 0 46px;
  border: 0;
  border-radius: 999px;
  background: #d5d8dc;
  box-shadow: none;
  position: relative;
  cursor: pointer;
  transition: background .2s ease;
}
.panel .switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #00000040;
  transition: transform .2s ease;
}
.panel .switch input:checked { background: var(--green); }
.panel .switch input:checked::after { transform: translateX(18px); }
.switch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px; }
.switch-grid .switch { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.pills button { border: 1px solid var(--line); background: #f7faf8; color: var(--text); border-radius: 999px; padding: 8px 12px; }
.seq { display: flex; flex-wrap: wrap; gap: 8px; min-height: 42px; padding: 8px; border: 1px dashed var(--line); border-radius: 12px; }
.seq span { background: var(--green-soft); color: var(--green-text); border-radius: 999px; padding: 6px 10px; font-size: 13px; cursor: pointer; font-weight: 700; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 18px; }
legend { color: var(--green-text); padding: 0 6px; font-weight: 700; }
.adx-row { display: grid; grid-template-columns: 1fr 90px 40px; gap: 8px; margin-top: 8px; }
.adx-row button { margin: 0; background: #fdecea; color: var(--danger); border: 0; border-radius: 10px; }
.add { margin-top: 10px; background: #fff; color: var(--green-text); border: 1px solid var(--green); border-radius: 10px; padding: 8px 12px; font-weight: 700; }
.toast { position: fixed; right: 24px; bottom: 24px; background: var(--green-dark); color: #fff; padding: 12px 16px; border-radius: 12px; z-index: 40; }
.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table th { color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.data-table td { font-weight: 600; word-break: break-all; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 16px; }
.pager button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 700; }
.pager button:disabled { opacity: .45; cursor: default; }
.pager span { color: var(--muted); font-weight: 700; font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(180px, 280px)); gap: 16px; }
.stats-4 { grid-template-columns: repeat(4, minmax(150px, 1fr)); margin-bottom: 16px; }
#notifSendBtn:disabled { opacity: .6; cursor: default; }
.notif-dialog { width: min(520px, calc(100% - 32px)); border: 0; border-radius: 16px; padding: 26px; box-shadow: 0 16px 48px #00000033; color: var(--text); }
.notif-dialog::backdrop { background: #0f1a1499; }
.notif-dialog h2 { margin: 0 0 4px; font-size: 22px; }
.notif-dialog .hint { margin: 0; font-size: 14px; }
.notif-dialog label { display: block; margin-top: 14px; font-size: 13px; color: var(--muted); }
.notif-dialog textarea { resize: vertical; }
.notif-preview { display: block; margin-top: 10px; max-width: 100%; max-height: 180px; border-radius: 10px; }
.notif-preview[hidden] { display: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.btn-ghost { border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 10px; padding: 12px 18px; font-weight: 700; }
.notif-body { margin-top: 4px; color: var(--muted); font-weight: 500; word-break: break-word; }
.notif-link { display: inline-block; margin-top: 4px; color: var(--green-text); font-size: 12px; }
.notif-thumb { width: 72px; height: 44px; object-fit: cover; border-radius: 8px; }
.muted-sm { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.rate { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.rate-bar { width: 70px; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.rate-bar i { display: block; height: 100%; background: var(--green); }
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .drawer { flex-direction: row; overflow: auto; }
  .stats, .grid2, .switch-grid { grid-template-columns: 1fr; }
  .main { padding: 20px 16px 48px; }
}
