/* Breezi Affiliates — Partner Portal */

.baff-portal-page {
  padding: 48px 0 80px;
}

.baff-portal-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.baff-portal-page--auth .baff-portal-inner {
  max-width: 1040px;
}

.baff-auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.baff-auth-brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.baff-auth-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.1;
  margin: 0;
}

.baff-auth-title em {
  font-style: italic;
}

.baff-auth-lead {
  color: rgba(10, 10, 10, .68);
  max-width: 36ch;
  margin: 0;
}

.baff-auth-perks {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.baff-auth-perks li::before {
  content: "✓ ";
  font-weight: 700;
}

.baff-auth-card {
  background: #fff;
  border: 1px solid var(--gray-200, #e5e5e5);
  border-radius: var(--r-xl, 24px);
  padding: 36px 32px 28px;
  box-shadow: var(--sh-sm, 0 2px 8px rgba(0, 0, 0, .04));
}

.baff-auth-card h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.baff-auth-footer {
  margin-top: 20px;
  text-align: center;
  font-size: .9rem;
}

.baff-dash {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.baff-sidebar {
  background: #fff;
  border: 1px solid var(--gray-200, #e5e5e5);
  border-radius: var(--r-xl, 24px);
  padding: 20px;
}

.baff-sidebar-user {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-200, #e5e5e5);
}

.baff-kicker {
  margin: 0 0 4px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(10, 10, 10, .5);
}

.baff-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.baff-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md, 12px);
  color: var(--gray-700, #444);
  text-decoration: none;
  font-weight: 600;
  transition: background .18s ease, color .18s ease;
}

.baff-nav-link:hover,
.baff-nav-link.is-active {
  background: var(--gray-50, #f9f9f9);
  color: var(--black, #0a0a0a);
}

.baff-nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.baff-sidebar-foot {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200, #e5e5e5);
}

.baff-main-inner {
  display: grid;
  gap: 16px;
}

.baff-card {
  background: #fff;
  border: 1px solid var(--gray-200, #e5e5e5);
  border-radius: var(--r-lg, 20px);
  padding: 24px;
}

.baff-section-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.baff-hint {
  margin: 0 0 12px;
  color: rgba(10, 10, 10, .6);
  font-size: .92rem;
}

.baff-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.baff-stat {
  background: #fff;
  border: 1px solid var(--gray-200, #e5e5e5);
  border-radius: var(--r-lg, 20px);
  padding: 18px;
}

.baff-stat--highlight {
  background: linear-gradient(135deg, #f8fafc, #fff);
  border-color: #dbeafe;
}

.baff-stat-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(10, 10, 10, .5);
  margin-bottom: 6px;
}

.baff-stat strong {
  font-size: 1.35rem;
}

.baff-form {
  display: grid;
  gap: 14px;
}

.baff-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: .9rem;
}

.baff-form input,
.baff-form select,
.baff-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-200, #e5e5e5);
  border-radius: var(--r-md, 12px);
  font: inherit;
}

.baff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.baff-grid-full {
  grid-column: 1 / -1;
}

.baff-grid-span-2 {
  grid-column: 1 / -1;
}

.baff-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
}

.baff-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 0;
  border-radius: var(--r-full, 999px);
  background: var(--black, #0a0a0a);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform .18s ease, opacity .18s ease;
}

.baff-btn:hover {
  opacity: .92;
}

.baff-btn--accent {
  background: var(--accent, #2563eb);
}

.baff-btn--outline {
  background: transparent;
  color: var(--black, #0a0a0a);
  border: 1px solid var(--gray-300, #d4d4d4);
}

.baff-btn--block {
  width: 100%;
}

.baff-btn--small {
  padding: 8px 14px;
  font-size: .85rem;
}

.baff-msg {
  padding: 12px 14px;
  border-radius: var(--r-md, 12px);
  margin: 0 0 12px;
}

.baff-msg--ok {
  background: #edf9f0;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.baff-msg--warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.baff-msg--err,
.baff-msg--error {
  background: #fff5f5;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.baff-copy-wrap {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.baff-copy {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--gray-200, #e5e5e5);
  border-radius: var(--r-md, 12px);
  background: var(--gray-50, #f9f9f9);
  font: inherit;
}

.baff-copy--code {
  font-size: clamp(1rem, 3vw, 1.35rem);
  font-weight: 800;
  letter-spacing: .08em;
  text-align: center;
}

.baff-copy-btn {
  flex-shrink: 0;
  padding: 12px 16px;
  border: 1px solid var(--gray-200, #e5e5e5);
  border-radius: var(--r-md, 12px);
  background: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.baff-copy-btn.is-copied {
  background: #edf9f0;
  border-color: #bbf7d0;
}

.baff-table-wrap {
  overflow-x: auto;
}

.baff-table {
  width: 100%;
  border-collapse: collapse;
}

.baff-table th,
.baff-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-200, #e5e5e5);
  text-align: left;
}

.baff-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.baff-badge--credit { background: #edf9f0; color: #166534; }
.baff-badge--payout { background: #eff6ff; color: #1d4ed8; }
.baff-badge--refund { background: #fff5f5; color: #991b1b; }

.baff-inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.baff-link {
  color: var(--black, #0a0a0a);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.baff-field-label {
  display: block;
  margin-bottom: 8px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(10, 10, 10, .55);
}

.baff-commission-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.baff-commission-input {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.baff-commission-value {
  flex: 1 1 auto;
  min-width: 0;
}

.baff-commission-toggle {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--gray-200, #e5e5e5);
  border-radius: 999px;
  background: var(--gray-50, #f9f9f9);
  gap: 4px;
}

.baff-commission-unit {
  min-width: 42px;
  padding: 10px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--gray-600, #666);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
}

.baff-commission-unit.is-active {
  background: var(--black, #0a0a0a);
  color: #fff;
}

.baff-share-summary {
  margin-top: 8px;
  font-size: .76rem;
  color: rgba(10, 10, 10, .55);
}

.baff-period-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.baff-period {
  background: var(--gray-50, #f9f9f9);
  border-radius: var(--r-md, 12px);
  padding: 16px;
}

.baff-period ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.baff-status-card {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  background: #fff;
  border: 1px solid var(--gray-200, #e5e5e5);
  border-radius: var(--r-xl, 24px);
  padding: 36px 28px;
}

.baff-status-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.baff-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.baff-mobile-top {
  display: none;
}

body.baff-portal-active .site-main > .container {
  padding-top: 16px !important;
  padding-bottom: 40px !important;
  max-width: 100%;
  overflow-x: clip;
}

body.baff-portal-active .entry-content,
body.baff-portal-active .page-content,
body.baff-portal-active .baff-portal-page,
body.baff-portal-active .baff-portal-inner,
body.baff-portal-active .baff-dash,
body.baff-portal-active .baff-main,
body.baff-portal-active .baff-sidebar,
body.baff-portal-active .baff-main-inner,
body.baff-portal-active .baff-card {
  min-width: 0;
  max-width: 100%;
}

body.baff-portal-active .entry-content > *:not(.baff-portal-page) {
  max-width: 100%;
}

@media (max-width: 960px) {
  .baff-auth-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .baff-auth-brand {
    text-align: center;
    align-items: center;
  }

  .baff-auth-lead { max-width: none; }

  .baff-dash {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .baff-sidebar {
    position: static;
    z-index: 1;
    padding: 14px;
    border-radius: var(--r-lg, 20px);
    box-shadow: none;
    overflow: visible;
  }

  .baff-mobile-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200, #e5e5e5);
  }

  .baff-mobile-user {
    min-width: 0;
    flex: 1 1 auto;
  }

  .baff-mobile-user strong {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .baff-mobile-logout {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: var(--r-full, 999px);
    background: var(--gray-50, #f9f9f9);
    color: var(--gray-600, #666);
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
  }

  .baff-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    overflow: visible;
  }

  .baff-nav-link {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    justify-content: center;
    white-space: nowrap;
    border-radius: var(--r-full, 999px);
    padding: 10px 12px;
    font-size: .82rem;
    background: var(--gray-50, #f9f9f9);
  }

  .baff-nav-link.is-active {
    background: var(--black, #0a0a0a);
    color: #fff;
  }

  .baff-nav-link--logout {
    display: none;
  }

  .baff-sidebar-user,
  .baff-sidebar-foot {
    display: none;
  }

  .baff-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .baff-stat--highlight {
    grid-column: 1 / -1;
  }

  .baff-card {
    padding: 18px 16px;
  }

  .baff-copy-wrap {
    flex-wrap: wrap;
  }

  .baff-copy {
    width: 100%;
    max-width: 100%;
  }

  .baff-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  .baff-table-wrap--cards .baff-table thead {
    display: none;
  }

  .baff-table-wrap--cards .baff-table tbody tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--gray-200, #e5e5e5);
    border-radius: var(--r-md, 12px);
    padding: 12px;
  }

  .baff-table-wrap--cards .baff-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    padding: 6px 0;
  }

  .baff-table-wrap--cards .baff-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: rgba(10, 10, 10, .55);
  }
}

@media (max-width: 640px) {
  .baff-portal-page {
    padding: 20px 0 48px;
  }

  .baff-portal-inner {
    padding: 0;
  }

  body.baff-portal-active .site-main > .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .baff-auth-card {
    padding: 28px 20px 24px;
  }

  .baff-grid,
  .baff-period-grid,
  .baff-stats {
    grid-template-columns: 1fr;
  }

  .baff-stat--highlight {
    grid-column: auto;
  }

  .baff-nav-link {
    flex: 1 1 calc(50% - 8px);
    font-size: .8rem;
    padding: 10px 10px;
  }

  .baff-nav-icon {
    width: 16px;
    height: 16px;
  }

  .baff-copy-wrap {
    flex-direction: column;
  }

  .baff-copy-btn,
  .baff-btn {
    width: 100%;
  }

  .baff-copy--code {
    font-size: 1.05rem;
    letter-spacing: .04em;
  }

  .baff-commission-input {
    flex-direction: column;
  }
}

@media (max-width: 380px) {
  .baff-nav-link {
    flex: 1 1 100%;
  }

  .baff-mobile-top {
    flex-wrap: wrap;
  }

  .baff-mobile-logout {
    width: 100%;
    text-align: center;
  }
}
