/*
 * Portal additions (khach.71.zone customers, ctv.71.zone partners): the same Platinum tokens as the CRM (platinum.css, load it first),
 * but friendlier and mobile-first: one column, 16px body text, 48px touch targets from the start, cards by default (tables only >= 1024px),
 * the bottom control strip as the primary nav on mobile. Still no window frame, no dark mode, ONE default ring per view.
 */

body.portal {
  font-size: 16px;
  line-height: 1.4;
}
.portal-page {
  min-height: 100vh;
  padding: 12px 12px calc(84px + env(safe-area-inset-bottom));
}
.portal-shell {
  max-width: 720px;
  margin: 0 auto;
}
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.portal-brand {
  margin: 0;
  font-size: 22px;
  font-weight: bold;
}
.portal-main {
  display: grid;
  gap: 12px;
}
.portal-body {
  padding: 12px;
  display: grid;
  gap: 12px;
}
.portal-page .pt-control,
.portal-page .pt-field-text,
.portal-auth .pt-control,
.portal-auth .pt-field-text {
  min-height: 48px;
  font-size: 16px;
}
.portal-page .pt-field,
.portal-auth .pt-field {
  font-size: 16px;
}

/* sign-in / forgot / set-password pages */
.portal-auth {
  display: grid;
  min-height: 100vh;
  padding: 16px 12px;
  place-items: center;
}
.portal-auth .pt-panel {
  width: min(440px, 100%);
}
.portal-form {
  display: grid;
  gap: 14px;
  padding: 16px 14px 18px;
  font-size: 16px;
}
.portal-form p {
  margin: 0;
}
.portal-lead {
  color: var(--pt-ink-2);
}
.portal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.portal-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* cards: the default list layout; one card = one raised white box */
.portal-cards {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.portal-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: var(--pt-white);
  border: 1px solid var(--pt-ink);
  border-radius: var(--pt-radius);
  box-shadow: var(--pt-raise);
}
.portal-card h3 {
  font-size: 18px;
}
.portal-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  margin: 0;
}
.portal-card dt {
  font-weight: bold;
  color: var(--pt-ink-2);
}
.portal-card dd {
  margin: 0;
}
.portal-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* bottom control strip is the primary nav under 768px; a top row from 768px */
.portal-nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10;
  display: flex;
  gap: 4px;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: repeating-linear-gradient(to bottom, #ddd 0 1px, #ccc 1px 2px);
  border-top: 2px solid var(--pt-ink);
  box-shadow: inset 0 1px 0 #fff;
}
.portal-nav a {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 6px;
  font-weight: bold;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
}

@media (min-width: 768px) {
  .portal-page {
    padding-bottom: 24px;
  }
  .portal-nav {
    position: static;
    margin: 0 0 12px;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .portal-nav a {
    flex: 0 0 auto;
    min-width: 140px;
  }
  .portal-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
/* tables only from 1024px; below that use .portal-cards */
.portal-table {
  display: none;
}
@media (min-width: 1024px) {
  .portal-shell {
    max-width: 960px;
  }
  .portal-table {
    display: table;
  }
  .portal-cards.portal-cards-narrow {
    display: none;
  }
}
