/* ============================================================
   AdWave · Components — implements the design handoff in WP.
   Scoped under .adw to avoid clashing with the theme.
   ============================================================ */

.adw, .adw * { box-sizing: border-box; }
.adw {
  font-family: var(--font);
  color: var(--ink);
  direction: rtl;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: 24px;
}
.adw .tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "lnum" 1; }

/* ---- Typography helpers ---- */
.adw-h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: 800; color: var(--ink); margin: 0; }
.adw-h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 700; margin: 0; }
.adw-sub { font-size: var(--fs-bodyl); color: var(--slate); margin-top: 6px; }
.adw-muted { color: var(--muted); }
.adw-strike { text-decoration: line-through; color: var(--muted); }
.adw-price { font-weight: 800; color: var(--brand-deep); }
.adw-price--lg { font-size: 28px; line-height: 1; }
.adw-from { font-size: 12px; color: var(--muted); }

/* ---- Buttons ---- */
.adw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: var(--fs-body); border: 1.5px solid transparent;
  border-radius: var(--r-md); padding: 11px 20px; cursor: pointer; text-decoration: none;
  transition: background .15s, box-shadow .15s, transform .05s, border-color .15s; line-height: 1;
}
.adw-btn--sm { padding: 8px 14px; font-size: var(--fs-sm); }
.adw-btn--lg { padding: 14px 26px; font-size: var(--fs-bodyl); }
.adw-btn--full { width: 100%; }
.adw-btn--primary { background: var(--brand); color: #fff; }
.adw-btn--primary:hover { background: var(--brand-hover); box-shadow: var(--sh-brand); }
.adw-btn--primary:active { transform: translateY(1px); }
.adw-btn--secondary { background: #fff; color: var(--brand); border-color: var(--brand); }
.adw-btn--secondary:hover { background: var(--brand-tint); }
.adw-btn--accent { background: var(--accent); color: #fff; }
.adw-btn--ghost { background: var(--surface); color: var(--slate); border-color: var(--border); }

/* ---- Badges & status pills ---- */
.adw-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--fs-cap); font-weight: 600; line-height: 1;
  padding: 5px 9px; border-radius: var(--r-pill); white-space: nowrap;
}
.adw-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.adw-badge--abs { position: absolute; }
.adw-tone-neutral { background: #f1f5f9; color: var(--slate); }
.adw-tone-brand   { background: var(--brand-tint); color: var(--brand-deep); }
.adw-tone-accent  { background: var(--accent-tint); color: #92400e; }
.adw-tone-success { background: var(--success-tint); color: #166534; }
.adw-tone-warning { background: var(--warning-tint); color: #92400e; }
.adw-tone-error   { background: var(--error-tint); color: #991b1b; }
.adw-tone-info    { background: var(--info-tint); color: #1e40af; }
.adw-badge--solid.adw-tone-accent { background: var(--accent); color: #fff; }

.adw-status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; padding: 5px 10px; border-radius: var(--r-pill); }
.adw-status__dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; opacity: .9; }
.adw-status.adw-tone-neutral { background: #f1f5f9; color: #475569; }
.adw-status.adw-tone-brand   { background: var(--brand-tint); color: var(--brand); }
.adw-status.adw-tone-success { background: var(--success-tint); color: var(--success); }
.adw-status.adw-tone-warning { background: var(--warning-tint); color: var(--warning); }
.adw-status.adw-tone-error   { background: var(--error-tint); color: var(--error); }
.adw-status.adw-tone-info    { background: var(--info-tint); color: var(--info); }

/* ---- Card ---- */
.adw-card {
  background: var(--white); border: 1.5px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--sh-sm); transition: transform .15s, box-shadow .15s, border-color .15s;
  display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: inherit;
}
.adw-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }

/* ---- Chips (niche filter) ---- */
.adw-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.adw-chip {
  border: 1.5px solid var(--border); background: #fff; color: var(--slate);
  border-radius: var(--r-pill); padding: 8px 16px; font-size: var(--fs-sm); font-weight: 600;
}
.adw-chip:hover { border-color: var(--brand); color: var(--brand); }
.adw-chip.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---- Catalog bar ---- */
.adw-catalog__head { padding-top: 8px; }
.adw-catalog__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.adw-toggle { display: inline-flex; border: 1.5px solid var(--border); border-radius: var(--r-pill); overflow: hidden; }
.adw-toggle__btn { background: #fff; border: 0; padding: 9px 18px; font-size: var(--fs-sm); font-weight: 600; color: var(--slate); }
.adw-toggle__btn.is-active { background: var(--brand); color: #fff; }
.adw-sort { display: inline-flex; align-items: center; gap: 8px; color: var(--slate); font-size: var(--fs-sm); }
.adw-select { border: 1.5px solid var(--border); border-radius: var(--r-sm); padding: 8px 12px; font-family: inherit; background: #fff; }
.adw-count { color: var(--muted); font-size: var(--fs-sm); margin-bottom: 14px; }

/* ---- Grid ---- */
.adw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ---- SiteCard ---- */
.adw-sitecard__media { position: relative; }
.adw-sitecard__media img { width: 100%; height: 130px; object-fit: cover; display: block; }
.adw-placeholder {
  height: 130px; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(135deg, #ecfeff, #ecfeff 12px, #f0fdfa 12px, #f0fdfa 24px);
  color: var(--muted); font-size: var(--fs-sm); border-bottom: 1px solid var(--border);
}
.adw-sitecard__media .adw-badge--abs { top: 10px; inset-inline-start: 10px; }
.adw-sitelogo {
  position: absolute; bottom: -22px; inset-inline-end: 14px; width: 48px; height: 48px;
  border-radius: var(--r-md); background: var(--brand); color: #fff; display: flex;
  align-items: center; justify-content: center; font-weight: 800; font-size: 20px;
  border: 3px solid #fff; box-shadow: var(--sh-sm);
}
.adw-sitecard__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.adw-sitecard__title-wrap { padding-inline-end: 56px; }
.adw-sitecard__title-wrap .adw-badges { margin-top: 6px; }
.adw-sitecard__desc { font-size: 13.5px; color: var(--slate); line-height: 1.5; margin: 0; }
.adw-metrics { display: flex; gap: 8px; padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.adw-metrics--head { border: 0; padding: 12px 0 0; }
.adw-metric { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.adw-metric__icon { font-size: 15px; }
.adw-metric__val { display: block; font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.adw-metric__label { display: block; font-size: 11px; color: var(--muted); }
.adw-sitecard__foot { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; padding-top: 4px; }
.adw-sitecard__foot .adw-price { font-size: 22px; line-height: 1; }

/* ---- PackageCard ---- */
.adw-pkgcard { border-color: #99f6e4; }
.adw-pkgcard__head { background: linear-gradient(135deg, var(--brand-deep), var(--brand)); padding: 16px 18px; color: #fff; position: relative; }
.adw-pkgcard__head .adw-badge--abs { top: 14px; inset-inline-start: 14px; }
.adw-pkgcard__icon { font-size: 24px; }
.adw-pkgcard__title { color: #fff; margin-top: 8px; font-size: 20px; }
.adw-pkgcard__includes { font-size: 13.5px; color: rgba(255,255,255,.85); margin-top: 4px; line-height: 1.5; }
.adw-pkgcard__body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.adw-pkgcard__foot { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }
.adw-pkgcard__orig { display: flex; align-items: center; gap: 8px; }
.adw-pkgcard__orig .adw-strike { font-size: 13px; }
.adw-pkgcard__foot .adw-price { font-size: 24px; line-height: 1.1; }
.adw-pkgcard__quote { font-size: 15px; font-weight: 700; color: var(--brand-deep); }

/* ---- Empty ---- */
.adw-empty { padding: 48px 24px; text-align: center; color: var(--muted); border: 1.5px dashed var(--border); border-radius: var(--r-md); }

/* ---- Single site ---- */
.adw-single__wrap { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; padding-top: 8px; }
.adw-single__head { padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.adw-single__head-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.adw-single__desc { color: var(--slate); margin-top: 10px; }
.adw-tabs { display: flex; gap: 6px; border-bottom: 1.5px solid var(--border); margin-bottom: 18px; }
.adw-tab { background: none; border: 0; padding: 12px 18px; font-weight: 700; font-size: var(--fs-h4); color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
.adw-tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.adw-tabpanel { display: none; }
.adw-tabpanel.is-active { display: block; }

.adw-placements, .adw-tracks { display: flex; flex-direction: column; gap: 12px; }
.adw-placement, .adw-track {
  display: flex; align-items: center; gap: 14px; padding: 16px; cursor: pointer;
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--r-md); transition: border-color .15s, box-shadow .15s;
}
.adw-placement:hover, .adw-track:hover { border-color: var(--brand); }
.adw-placement:has(input:checked), .adw-track:has(input:checked) { border-color: var(--brand); box-shadow: var(--sh-brand); background: var(--brand-tint); }
.adw-placement.is-disabled { opacity: .55; cursor: not-allowed; }
.adw-placement__info, .adw-track__info { flex: 1; min-width: 0; }
.adw-placement__name, .adw-track__name { font-weight: 700; }
.adw-placement__note, .adw-track__sub, .adw-track__note { font-size: var(--fs-sm); color: var(--slate); margin-top: 3px; }
.adw-placement__price { text-align: start; }
.adw-placement__price .adw-price, .adw-track__price { font-size: 18px; }
.adw-placement__price .adw-muted { display: block; font-size: 12px; }

/* ---- Price meter (aside) ---- */
.adw-single__aside { position: sticky; top: 24px; }
.adw-pricemeter { background: #fff; border: 1.5px solid var(--border); border-radius: var(--r-md); box-shadow: var(--sh-md); padding: 20px; }
.adw-pricemeter__title { font-weight: 800; font-size: var(--fs-h4); margin-bottom: 12px; }
.adw-pricemeter__line { display: flex; justify-content: space-between; font-size: var(--fs-sm); padding: 6px 0; }
.adw-pricemeter__total { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; font-weight: 700; }
.adw-pricemeter .adw-btn { margin-top: 16px; }
.adw-pricemeter__hint { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ---- Toast ---- */
.adw-toast {
  position: fixed; inset-inline: 0; bottom: 24px; margin-inline: auto; width: max-content; max-width: 90vw;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: var(--r-md);
  box-shadow: var(--sh-lg); z-index: 9999; animation: adw-flip .3s ease;
}

/* ---- Responsive (RTL · mobile-first) ---- */
@media (max-width: 980px) {
  .adw-grid { grid-template-columns: repeat(2, 1fr); }
  .adw-single__wrap { grid-template-columns: 1fr; }
  .adw-single__aside { position: static; }
}
@media (max-width: 640px) {
  .adw-grid { grid-template-columns: 1fr; }
  .adw-h1 { font-size: 26px; line-height: 32px; }
  .adw-catalog__bar { flex-direction: column; align-items: stretch; }
}

/* ============================================================
   Wizard (v0.3)
   ============================================================ */
.adw-wizard__head { padding-top: 8px; margin-bottom: 8px; }
.adw-stepper { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 22px; flex-wrap: wrap; }
.adw-step { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); font-size: var(--fs-sm); padding: 8px 14px; border: 1.5px solid var(--border); border-radius: var(--r-pill); background: #fff; }
.adw-step__num { width: 22px; height: 22px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: #e2e8f0; color: var(--slate); font-size: 12px; }
.adw-step.is-active { color: var(--brand); border-color: var(--brand); }
.adw-step.is-active .adw-step__num { background: var(--brand); color: #fff; }
.adw-step.is-done { color: var(--success); border-color: #bbf7d0; }
.adw-step.is-done .adw-step__num { background: var(--success); color: #fff; }

.adw-wizard__wrap { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.adw-wstep { display: none; }
.adw-wstep.is-active { display: block; animation: adw-rise .25s ease; }
.adw-wizard__nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.adw-wizard__aside { position: sticky; top: 24px; }

.adw-field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.adw-field label { font-weight: 600; font-size: var(--fs-sm); color: var(--slate); }
.adw-input { width: 100%; border: 1.5px solid var(--border); border-radius: var(--r-sm); padding: 11px 12px; font-family: inherit; font-size: var(--fs-body); background: #fff; }
.adw-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,110,.12); }
.adw-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.adw-link { background: none; border: 0; color: var(--brand); font-weight: 700; cursor: pointer; padding: 0; }

.adw-dropzone { border: 2px dashed var(--border); border-radius: var(--r-md); padding: 26px; text-align: center; background: var(--surface); margin-bottom: 14px; transition: border-color .15s, background .15s; }
.adw-dropzone.is-over { border-color: var(--brand); background: var(--brand-tint); }
.adw-dropzone__icon { font-size: 28px; margin-bottom: 6px; }
.adw-dropzone__done { margin-top: 12px; color: var(--success); font-weight: 700; }

.adw-ai-status { margin: 10px 0; padding: 10px 14px; border-radius: var(--r-sm); background: var(--brand-tint); color: var(--brand-deep); font-size: var(--fs-sm); }

.adw-summary { width: 100%; border-collapse: collapse; }
.adw-summary th, .adw-summary td { text-align: start; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.adw-summary th { color: var(--slate); font-weight: 600; width: 120px; }
.adw-summary .adw-price { font-size: 20px; }

@media (max-width: 980px) {
  .adw-wizard__wrap { grid-template-columns: 1fr; }
  .adw-wizard__aside { position: static; }
}
@media (max-width: 640px) {
  .adw-grid2 { grid-template-columns: 1fr; }
}

/* ============================================================
   Account & draft approval (v0.4)
   ============================================================ */
.adw-ov-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.adw-ov-card { border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 16px; text-align: center; background: #fff; }
.adw-ov-card__num { font-size: 30px; font-weight: 800; line-height: 1; }
.adw-ov-card__lbl { font-size: var(--fs-sm); color: var(--slate); margin-top: 4px; }
.adw-ov-card.adw-tone-warning { border-color: #fde68a; }
.adw-ov-card.adw-tone-warning .adw-ov-card__num { color: var(--warning); }
.adw-ov-card.adw-tone-brand .adw-ov-card__num { color: var(--brand); }
.adw-ov-card.adw-tone-success { border-color: #bbf7d0; }
.adw-ov-card.adw-tone-success .adw-ov-card__num { color: var(--success); }

.adw-art-list { display: flex; flex-direction: column; gap: 10px; }
.adw-art-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: var(--r-md); background: #fff; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.adw-art-row:hover { border-color: var(--brand); box-shadow: var(--sh-sm); }
.adw-art-row__main { flex: 1; min-width: 0; }
.adw-art-row__title { font-weight: 700; }
.adw-art-row__arrow { color: var(--muted); font-size: 18px; }

.adw-note { padding: 12px 16px; border-radius: var(--r-md); margin: 14px 0; font-weight: 600; }
.adw-note.adw-tone-success { background: var(--success-tint); color: #166534; }
.adw-note.adw-tone-info { background: var(--info-tint); color: #1e40af; }
.adw-note.adw-tone-warning { background: var(--warning-tint); color: #92400e; }
.adw-note.adw-tone-brand { background: var(--brand-tint); color: var(--brand-deep); }

.adw-draft__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 8px; }
.adw-progress { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 14px 0; margin: 0 0 18px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.adw-progress__step { display: flex; align-items: center; gap: 7px; font-size: var(--fs-sm); color: var(--muted); }
.adw-progress__dot { width: 9px; height: 9px; border-radius: 999px; background: #cbd5e1; }
.adw-progress__step.is-done { color: var(--success); }
.adw-progress__step.is-done .adw-progress__dot { background: var(--success); }
.adw-progress__step.is-active { color: var(--brand); font-weight: 700; }
.adw-progress__step.is-active .adw-progress__dot { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }

.adw-draft__doc { background: #fff; border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 22px 26px; line-height: 1.8; box-shadow: var(--sh-sm); }
.adw-draft__doc p { margin: 0 0 1em; }
.adw-draft__actions { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.adw-draft__actions form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.adw-draft__rev { font-size: var(--fs-sm); }
.adw-revbox { border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 6px 12px; }
.adw-revbox summary { cursor: pointer; list-style: none; }
.adw-revbox[open] { padding-bottom: 12px; }
.adw-revbox textarea { margin: 10px 0; }

@media (max-width: 640px) {
  .adw-ov-cards { grid-template-columns: 1fr 1fr; }
  .adw-draft__head { flex-direction: column; align-items: flex-start; }
}

/* Invoices table + reports (v0.6) */
.adw-table { width: 100%; border-collapse: collapse; background: #fff; }
.adw-table th, .adw-table td { text-align: start; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.adw-table th { color: var(--slate); font-weight: 700; background: var(--surface); }
.adw-report__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
