/* Travespert partner dashboard (/affiliate-area/), inc/affiliate-dashboard.php */

body.tv-ad-page { background: var(--tv-surface, #f7f7f7); }
body.tv-ad-page article { width: 100% !important; max-width: calc(1280px + 2 * var(--tv-gutter, 16px)) !important; box-sizing: border-box; margin: 0 auto; padding: 28px var(--tv-gutter, 16px) 64px !important; }
body.tv-ad-page article > h1, body.tv-ad-page article > header { display: none; }

.tv-ad {
  --ad-white: #fff;
  --ad-line: var(--tv-hairline-soft, #ebebeb);
  --ad-soft: var(--tv-surface, #f7f7f7);
  --ad-ink: var(--tv-ink, #1d1d1b);
  --ad-muted: var(--tv-muted, #6b6b66);
  --ad-dark: var(--tv-dark, #1f1f1f);
  --ad-acc: var(--tv-primary, #e0a526);
  --ad-tint: var(--tv-primary-tint, #fdf5e2);
  display: grid; grid-template-columns: 236px minmax(0, 1fr);
  background: var(--ad-white); border: 1px solid var(--ad-line); border-radius: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03), 0 12px 40px -24px rgba(0,0,0,.18);
  color: var(--ad-ink); font-size: 14px; line-height: 1.45; overflow: hidden;
}
.tv-ad svg { width: 16px; height: 16px; flex: none; }
.tv-ad h1, .tv-ad h2 { color: var(--ad-ink); margin: 0; letter-spacing: -0.01em; }

/* ---- sidebar ---- */
.tv-ad__side { background: var(--ad-soft); border-right: 1px solid var(--ad-line); padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.tv-ad__who { display: flex; align-items: center; gap: 10px; background: var(--ad-white); border: 1px solid var(--ad-line); border-radius: 12px; padding: 9px 10px; }
.tv-ad__avatar { width: 32px; height: 32px; border-radius: 9px; background: var(--ad-dark); color: var(--ad-acc); display: grid; place-items: center; font-weight: 700; flex: none; }
.tv-ad__whot { display: flex; flex-direction: column; min-width: 0; }
.tv-ad__whot b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-ad__whot small { color: var(--ad-muted); font-size: 12px; }
.tv-ad__nav { display: flex; flex-direction: column; gap: 2px; }
.tv-ad__nav hr { border: 0; border-top: 1px solid var(--ad-line); margin: 8px 4px; }
.tv-ad__navi { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--ad-ink) !important; text-decoration: none !important; font-weight: 500; transition: background .15s; }
.tv-ad__navi svg { color: var(--ad-muted); }
.tv-ad__navi:hover { background: rgba(0,0,0,.04); }
.tv-ad__navi.is-active { background: #e9e8e4; }
.tv-ad__navi.is-active svg { color: var(--ad-ink); }
.tv-ad__promo { margin-top: auto; position: relative; background: var(--ad-white); border: 1px solid var(--ad-line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.tv-ad__promo[hidden] { display: none; }
.tv-ad__promo b { font-size: 15px; font-weight: 600; margin-top: 6px; }
.tv-ad__promo p { margin: 0 0 8px; color: var(--ad-muted); font-size: 13px; }
.tv-ad__promoi { width: 38px; height: 38px; border: 1px solid var(--ad-line); border-radius: 10px; display: grid; place-items: center; background: var(--ad-tint); color: var(--ad-ink); }
.tv-ad__promoi svg { width: 20px; height: 20px; }
.tv-ad__promox { position: absolute; top: 8px; right: 8px; background: none; border: 0; padding: 4px; color: var(--ad-muted); cursor: pointer; }

/* ---- main ---- */
.tv-ad__main { padding: 18px 22px 24px; min-width: 0; }
.tv-ad__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; }
.tv-ad__crumb { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.tv-ad__upd { color: var(--ad-muted); font-size: 13px; }
.tv-ad__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 18px; }
.tv-ad__head h1 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 500; line-height: 1.2; }
.tv-ad__acts { display: flex; gap: 8px; }
.tv-ad__view[hidden] { display: none; }

/* buttons */
.tv-ad__btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--ad-line); background: var(--ad-white); color: var(--ad-ink) !important; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.tv-ad__btn:hover { background: var(--ad-soft); }
.tv-ad__btn:active { transform: translateY(1px); }
.tv-ad__btn--dark { background: var(--ad-dark); border-color: var(--ad-dark); color: #fff !important; }
.tv-ad__btn--dark:hover { background: #000; }
.tv-ad__btn--ghost { border-color: transparent; background: transparent; color: var(--ad-muted) !important; }
.tv-ad__btn--ghost:hover { background: rgba(0,0,0,.04); color: var(--ad-ink) !important; }
.tv-ad__btn--block { width: 100%; }
.tv-ad__btn.is-done { color: #1d7a46 !important; }
.tv-ad__btn--dark.is-done { color: #b8f0cd !important; }
.tv-ad__btn:focus-visible, .tv-ad__navi:focus-visible, .tv-ad__filters button:focus-visible { outline: 2px solid var(--ad-acc); outline-offset: 2px; }

/* stat cards */
.tv-ad__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.tv-ad__stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tv-ad__stat { display: flex; border: 1px solid var(--ad-line); border-radius: 14px; overflow: hidden; min-height: 92px; }
.tv-ad__statt { flex: 1; padding: 14px 14px 12px; display: flex; flex-direction: column; min-width: 0; }
.tv-ad__statt span { color: var(--ad-muted); font-size: 13px; }
.tv-ad__statt b { font-size: 28px; font-weight: 500; line-height: 1.15; margin-top: 6px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-ad__statt b.tv-ad__statsm { font-size: 17px; margin-top: 10px; }
.tv-ad__statt small { color: var(--ad-muted); font-size: 12px; margin-top: auto; padding-top: 4px; }
.tv-ad__stati { width: 74px; flex: none; background: var(--ad-soft); border-left: 1px solid var(--ad-line); display: grid; place-items: center; }
.tv-ad__stati svg { width: 40px; height: 40px; padding: 9px; border-radius: 10px; background: var(--ad-white); border: 1px solid var(--ad-line); color: var(--ad-ink); box-shadow: 0 6px 14px -8px rgba(0,0,0,.25); }

/* cards */
.tv-ad__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.tv-ad__card { border: 1px solid var(--ad-line); border-radius: 14px; padding: 14px 16px 16px; margin-bottom: 12px; min-width: 0; }
.tv-ad__row .tv-ad__card { margin-bottom: 0; }
.tv-ad__cardh { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tv-ad__cardh h2 { font-size: 15px; font-weight: 600; }
.tv-ad__chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ad-line); border-radius: 8px; padding: 4px 10px; font-size: 13px; background: var(--ad-soft); }
.tv-ad__more { font-size: 13px; color: var(--ad-muted) !important; text-decoration: underline !important; text-underline-offset: 3px; }
.tv-ad__more:hover { color: var(--ad-ink) !important; }
.tv-ad__sub { color: var(--ad-muted); font-size: 13px; margin: 0 0 12px; }
.tv-ad__note { color: var(--ad-muted); font-size: 13px; margin: 4px 2px 0; max-width: 72ch; }

/* chart */
.tv-ad svg.tv-ad__chart { width: 100%; height: auto; display: block; }
.tv-ad__chart .tv-ad__grid { stroke: var(--ad-line); stroke-width: 1; }
.tv-ad__chart .tv-ad__axis { fill: var(--ad-muted); font-size: 14px; font-family: inherit; }
.tv-ad__chart .tv-ad__hatch { stroke: #d9d6cf; stroke-width: 1.2; }
.tv-ad__chart .tv-ad__area { opacity: .9; }
.tv-ad__chart .tv-ad__line { fill: none; stroke: var(--ad-dark); stroke-width: 2; stroke-dasharray: 5 4; }
.tv-ad__chart .tv-ad__dot { fill: var(--ad-white); stroke: var(--ad-acc); stroke-width: 2.5; }
.tv-ad__chartwrap { position: relative; }
.tv-ad__chartempty { position: absolute; inset: 0 0 30px 56px; display: grid; place-items: center; margin: 0; color: var(--ad-muted); font-size: 13px; text-align: center; padding: 0 16px; }

/* tables */
.tv-ad__table { display: flex; flex-direction: column; gap: 6px; }
.tv-ad__tr { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) 110px 124px 90px; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--ad-line); border-radius: 9px; background: var(--ad-soft); }
.tv-ad__table--compact .tv-ad__tr { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) 124px 80px; }
.tv-ad__tr[hidden] { display: none; }
.tv-ad__tr--h { background: none; border-color: transparent; padding-top: 0; padding-bottom: 2px; color: var(--ad-muted); font-size: 12px; }
.tv-ad__tr > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tv-ad__trip { display: flex; align-items: center; gap: 8px; }
.tv-ad__trip svg { color: var(--ad-muted); }
.tv-ad__trip > span { display: flex; flex-direction: column; min-width: 0; }
.tv-ad__trip > span, .tv-ad__trip small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-ad__trip small { color: var(--ad-muted); font-size: 12px; }
.tv-ad__guest { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.tv-ad__guest i { width: 22px; height: 22px; border-radius: 50%; background: var(--ad-dark); color: #fff; font-style: normal; font-size: 11px; font-weight: 600; display: grid; place-items: center; flex: none; }
.tv-ad__num { text-align: right; }
.tv-ad__num b { font-weight: 600; }
.tv-ad__pill { display: inline-block; font-style: normal; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tv-ad__pill--pending { background: #eef1f7; color: #3b4a6b; }
.tv-ad__pill--unpaid { background: var(--ad-tint); color: #7a5300; }
.tv-ad__pill--paid { background: #e6f5ec; color: #1d6b3f; }
.tv-ad__pill--rejected { background: #f3f2ef; color: var(--ad-muted); text-decoration: line-through; }
.tv-ad__filters { display: inline-flex; background: var(--ad-soft); border: 1px solid var(--ad-line); border-radius: 9px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.tv-ad__filters button { border: 0; background: none; font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 7px; cursor: pointer; color: var(--ad-muted); }
.tv-ad__filters button.is-active { background: var(--ad-white); color: var(--ad-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* empty state */
.tv-ad__empty { border: 1px dashed var(--ad-line); border-radius: 12px; padding: 28px 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tv-ad__empty span { width: 42px; height: 42px; border-radius: 12px; background: var(--ad-soft); border: 1px solid var(--ad-line); display: grid; place-items: center; margin-bottom: 6px; }
.tv-ad__empty span svg { width: 20px; height: 20px; }
.tv-ad__empty b { font-weight: 600; }
.tv-ad__empty p { margin: 0; color: var(--ad-muted); font-size: 13px; max-width: 42ch; }

/* share kit */
.tv-ad__kit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tv-ad__kiti { border: 1px solid var(--ad-line); border-radius: 14px; background: var(--ad-soft); padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tv-ad__kitt { margin-bottom: 8px; }
.tv-ad__kitic { width: 76px; height: 50px; border-radius: 6px 10px 10px 10px; background: var(--ad-white); border: 1px solid var(--ad-line); display: grid; place-items: center; position: relative; box-shadow: 0 6px 14px -10px rgba(0,0,0,.3); }
.tv-ad__kitic::before { content: ''; position: absolute; left: -1px; top: -8px; width: 34px; height: 9px; border: 1px solid var(--ad-line); border-bottom: 0; border-radius: 6px 6px 0 0; background: var(--ad-white); }
.tv-ad__kitic svg { width: 20px; height: 20px; color: var(--ad-ink); }
.tv-ad__kiti > b { font-size: 15px; font-weight: 500; }
.tv-ad__kiti > p { margin: 0; color: var(--ad-muted); font-size: 13px; }
.tv-ad__kitv { margin: 8px 0 10px; background: var(--ad-white); border: 1px solid var(--ad-line); border-radius: 8px; padding: 8px 10px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-ad__kitv--code { font-size: 18px; font-weight: 700; letter-spacing: .08em; text-align: center; color: var(--ad-ink); background: var(--ad-tint); border-style: dashed; border-color: var(--ad-acc); }
.tv-ad__kitv--msg { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--ad-muted); }
.tv-ad__kitb { margin-top: auto; display: flex; gap: 6px; }
.tv-ad__kitb .tv-ad__btn--dark { flex: 1; }

/* trip link generator */
.tv-ad__gen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; }
.tv-ad__gen select, .tv-ad__gen input, .tv-ad__form textarea { height: 38px; border: 1px solid var(--ad-line); border-radius: 9px; padding: 0 10px; font: inherit; font-size: 13px; background: var(--ad-white); color: var(--ad-ink); min-width: 0; }
.tv-ad__gen input { background: var(--ad-soft); }
.tv-ad__steps { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; }

/* settings */
.tv-ad__form { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.tv-ad__form .tv-ad__cardh { margin: 12px 0 2px; }
.tv-ad__form .tv-ad__cardh:first-of-type { margin-top: 0; }
.tv-ad__form label { font-weight: 500; font-size: 13px; }
.tv-ad__form textarea { height: auto; padding: 10px; line-height: 1.45; resize: vertical; }
.tv-ad__form textarea:focus, .tv-ad__gen select:focus { outline: 2px solid var(--ad-acc); outline-offset: 1px; }
.tv-ad__check { display: flex; align-items: center; gap: 8px; font-weight: 400 !important; }
.tv-ad__dl { margin: 0; display: grid; gap: 6px; }
.tv-ad__dl div { display: grid; grid-template-columns: 130px 1fr; gap: 10px; }
.tv-ad__dl dt { color: var(--ad-muted); }
.tv-ad__dl dd { margin: 0; }
.tv-ad__toast { display: flex; align-items: center; gap: 8px; background: #e6f5ec; color: #1d6b3f; border-radius: 9px; padding: 9px 12px; margin-bottom: 12px; transition: opacity .4s; }
.tv-ad__toast.is-gone { opacity: 0; }

/* logged-out / not-a-partner */
.tv-ad-gate { max-width: 460px; margin: 24px auto; background: #fff; border: 1px solid var(--tv-hairline-soft, #ebebeb); border-radius: 18px; padding: 28px; }
.tv-ad-gate h1 { font-size: 24px; margin: 0 0 6px; }
.tv-ad-gate > p { color: var(--tv-muted, #6b6b66); margin: 0 0 16px; }
.tv-ad-gate .tv-ad-gate__alt { margin: 16px 0 0; font-size: 13px; text-align: center; }
.tv-ad-gate > p b { color: var(--tv-ink, #222); }
.tv-ad-gate__join { display: flex; align-items: center; justify-content: center; height: 46px; border-radius: 999px; background: var(--tv-primary, #ffb000); color: var(--tv-on-primary, #222) !important; font-weight: 600; text-decoration: none !important; }
.tv-ad-gate__join:hover { background: var(--tv-primary-hover, #f0a400); }
.tv-ad-gate__or { display: flex; align-items: center; gap: 10px; margin: 22px 0 6px; color: var(--tv-muted, #6a6a6a); font-size: 13px; }
.tv-ad-gate__or::before, .tv-ad-gate__or::after { content: ''; flex: 1; border-top: 1px solid var(--tv-hairline-soft, #ebebeb); }
.tv-ad-gate .affwp-form legend { display: none; }

/* ---- responsive ---- */
@media (max-width: 1100px) {
  .tv-ad__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tv-ad__row { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .tv-ad { grid-template-columns: minmax(0, 1fr); }
  .tv-ad__side { border-right: 0; border-bottom: 1px solid var(--ad-line); padding: 12px; gap: 10px; }
  .tv-ad__nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; }
  .tv-ad__nav::-webkit-scrollbar { display: none; }
  .tv-ad__nav hr { display: none; }
  .tv-ad__navi { flex: none; white-space: nowrap; }
  .tv-ad__promo { display: none; }
  .tv-ad__kit { grid-template-columns: 1fr; }
  .tv-ad__gen { grid-template-columns: 1fr; }
  .tv-ad__stats--3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body.tv-ad-page article { padding-top: 12px !important; }
  .tv-ad { border-radius: 16px; }
  .tv-ad__main { padding: 14px 12px 18px; }
  .tv-ad__upd { display: none; }
  .tv-ad__acts { width: 100%; }
  .tv-ad__acts .tv-ad__btn { flex: 1; }
  .tv-ad__stats { gap: 8px; }
  .tv-ad__stat { min-height: 0; }
  .tv-ad__stati { display: none; }
  .tv-ad__statt { padding: 12px; }
  .tv-ad__statt b { font-size: 22px; }
  .tv-ad__card { padding: 12px; }
  .tv-ad__tr--h { display: none; }
  .tv-ad__tr, .tv-ad__table--compact .tv-ad__tr { grid-template-columns: 1fr auto; gap: 6px 10px; padding: 10px; }
  .tv-ad__tr > [data-l="Trip"] { grid-column: 1; }
  .tv-ad__tr > [data-l="Commission"] { grid-column: 2; grid-row: 1; }
  .tv-ad__tr > [data-l="Guest"], .tv-ad__tr > [data-l="Travel date"] { font-size: 13px; color: var(--ad-muted); }
  .tv-ad__tr > [data-l="Status"] { grid-column: 2; text-align: right; }
  .tv-ad__tr > [data-l="Travel date"]::before { content: 'Travel '; }
  .tv-ad__tr > [data-l="Date"]::before, .tv-ad__tr > [data-l="Bookings"]::before, .tv-ad__tr > [data-l="Method"]::before { content: attr(data-l) ': '; color: var(--ad-muted); }
  .tv-ad__dl div { grid-template-columns: 1fr; gap: 0; }
  .tv-ad__chart .tv-ad__axis { font-size: 24px; }
  .tv-ad__chart .tv-ad__dot { r: 6; }
}
