/* Affiliate portal, styled after the HasOffers affiliate panel LunaSol affiliates already know. */
:root {
  --side: #424c5d; --side-dark: #363e4c; --side-ink: #e8ebef; --side-muted: #b4bcc8;
  --bg: #eef0f2; --panel: #fff; --ink: #3a3f47; --muted: #7b828c; --line: #e3e6ea;
  --teal: #1fa9b9; --teal-dark: #168896; --teal-soft: #e3f5f7; --bad: #c0392b; --good: #2e9d57; --warn: #b7791f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 Nunito, "Source Sans Pro", Helvetica, Arial, sans-serif; }
a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { height: 52px; background: #fff; border-bottom: 2px solid var(--teal); display: flex; align-items: center; justify-content: space-between; padding: 0 20px 0 14px; position: sticky; top: 0; z-index: 20; }
.topbar .logo img { height: 40px; display: block; }
.topbar .logo span { font-weight: 800; font-size: 20px; color: var(--teal); }
.topbar .right { display: flex; align-items: center; gap: 18px; font-size: 13px; }
.topbar .right a { color: var(--ink); border-bottom: 1px dotted var(--muted); }
.menu-toggle { display: none; background: none; border: 0; font-size: 22px; color: var(--ink); cursor: pointer; padding: 4px 8px; }

.shell { display: flex; min-height: calc(100vh - 52px); }
.side { width: 200px; flex: 0 0 200px; background: var(--side); color: var(--side-ink); font-size: 13.5px; padding-bottom: 24px; }
.side a { color: var(--side-ink); text-decoration: none; display: flex; align-items: center; gap: 8px; padding: 9px 14px; }
.side a:hover { background: var(--side-dark); }
.side .icon { width: 16px; text-align: center; opacity: .85; font-size: 13px; }
.side details summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 9px 14px; }
.side details summary::-webkit-details-marker { display: none; }
.side details summary::after { content: "⌄"; margin-left: auto; opacity: .7; }
.side details[open] summary::after { content: "⌃"; }
.side details summary:hover { background: var(--side-dark); }
.side .sub a { padding: 7px 14px 7px 18px; font-size: 13px; background: var(--side-dark); }
.side .sub a.on { font-weight: 700; color: #fff; }
.side a.on { font-weight: 700; color: #fff; }
.side .badge { background: var(--teal); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; margin-left: auto; }
.side .am { border-top: 1px solid #56606f; border-bottom: 1px solid #56606f; margin: 14px 0; padding: 12px 14px; font-size: 12.5px; color: var(--side-muted); }
.side .am b { display: block; color: #fff; font-size: 16px; font-weight: 600; margin: 2px 0; }
.side .am a { padding: 0; color: var(--side-ink); font-size: 12px; word-break: break-all; display: inline; }
.side .foot a { padding: 3px 14px; font-size: 12px; color: var(--side-muted); }

main.content { flex: 1; min-width: 0; padding: 26px 32px 60px; }
h1 { font-size: 30px; font-weight: 400; margin: 0 0 18px; color: #2f343b; }
h2 { font-size: 19px; font-weight: 400; margin: 0; }
.muted { color: var(--muted); }
.flash { background: var(--teal-soft); border-left: 4px solid var(--teal); padding: 10px 14px; margin-bottom: 16px; }
.alert { color: var(--bad); }

.card { background: var(--panel); border-top: 3px solid var(--teal); box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 20px; }
.card > .hd { padding: 14px 16px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card > .bd { padding: 4px 16px 16px; }
.card > .bd.flush { padding: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 6px 16px 16px; }
.stat .label { text-transform: uppercase; font-size: 15px; color: #3a3f47; letter-spacing: .01em; }
.stat .val { font-size: 22px; color: var(--muted); margin-top: 2px; }
.stat .chg { font-size: 11px; margin-top: 2px; }
.chg.up { color: var(--good); } .chg.down { color: var(--bad); }
.spark { display: block; margin-top: 6px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 400; color: #555b63; font-size: 13px; padding: 9px 10px; border-bottom: 2px solid var(--line); background: #fff; vertical-align: bottom; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13.5px; }
tbody tr:nth-child(even) td { background: #f7f8f9; }
tbody tr:hover td { background: var(--teal-soft); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 700; background: #fafbfc; }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; font-size: 24px; color: #555; padding: 50px 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 12px; background: #fff; border-top: 3px solid var(--teal); box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 14px; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 8px; font-size: 13px; margin: 8px 0; }
.pager a, .pager span.cur { padding: 2px 8px; border: 1px solid var(--line); background: #fff; }

input, select, textarea { font: inherit; font-size: 13.5px; padding: 6px 9px; border: 1px solid #cdd2d8; border-radius: 3px; background: #fff; color: var(--ink); max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal-soft); border-color: var(--teal); }
textarea { width: 100%; min-height: 60px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
label { display: block; font-size: 12.5px; color: var(--muted); margin: 8px 0 3px; }
.btn, button { display: inline-block; font: inherit; font-size: 13px; padding: 6px 12px; background: var(--teal); color: #fff; border: 0; border-radius: 2px; cursor: pointer; text-decoration: none; line-height: 1.4; }
.btn:hover, button:hover { background: var(--teal-dark); text-decoration: none; }
.btn.ghost, button.ghost { background: #fff; color: var(--ink); border: 1px solid #cdd2d8; }
.btn.small, button.small { padding: 3px 9px; font-size: 12px; }
.btn.preview { font-size: 12px; padding: 4px 8px; white-space: nowrap; }
.thumb { height: 26px; max-width: 90px; object-fit: contain; display: block; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 18px; }
.grid2 input[type=text], .grid2 input[type=email], .grid2 input[type=password], .grid2 select { width: 100%; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv div:nth-child(odd) { color: var(--muted); }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0 10px; }
.tabs button { background: #fff; color: var(--ink); border-radius: 12px; padding: 3px 12px; font-size: 12.5px; }
.tabs button.on { background: var(--teal); color: #fff; }
.tabpane { display: none; } .tabpane.on { display: block; }

.restricted { background: #fff8e6; border-left: 4px solid var(--warn); padding: 12px 14px; margin-bottom: 18px; }
.notes { font-size: 13.5px; }
.notes p { margin: 0 0 8px; }
.pill { display: inline-block; padding: 0 8px; border-radius: 99px; font-size: 12px; background: #eef0f2; }
.pill.active, .pill.approved { background: #e1f4e8; color: var(--good); }
.pill.pending { background: #fdf3dc; color: var(--warn); }
.pill.rejected, .pill.deleted { background: #fbe4e1; color: var(--bad); }

.chart { width: 100%; height: 190px; display: block; }
.chart .grid line { stroke: #eceff2; }
.chart .ax text { fill: #9aa1aa; font-size: 10px; }

/* public pages (login, sign-up) */
.public { max-width: 440px; margin: 7vh auto; padding: 0 16px; }
.public.wide { max-width: 820px; }
.public .logo { text-align: center; margin-bottom: 18px; }
.public .logo img { height: 56px; }
.public .card .bd { padding: 18px 20px 22px; }
.public input[type=email], .public input[type=password], .public input[type=text] { width: 100%; }
.public .row { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink); margin: 8px 0; }
.check input { margin-top: 3px; }
.hp { position: absolute; left: -5000px; }

@media (max-width: 820px) {
  .menu-toggle { display: block; }
  .side { position: fixed; top: 52px; left: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s; z-index: 15; overflow-y: auto; }
  body.menu-open .side { transform: none; }
  main.content { padding: 18px 16px 50px; }
  h1 { font-size: 24px; }
  .kv { grid-template-columns: 1fr; }
  .topbar .search { display: none; }
}
