/* ZONEZ — Dealer portal resources
   Figma: 2276:4369 (File table row, Section Tab), 2276:4152 (portal header)
   All values come from the global zz-* tokens. No literal colours. */

/* ── Portal header ─────────────────────────────────────────────────────── */

/* Title block left, logged-in user bottom-right. Figma: 2276:4152. */
.zz-portal-head {
  display: grid;
  grid-template-columns: minmax(0, 540px) minmax(0, 1fr);
  gap: var(--zz-space-48);
  align-items: end;
}

.zz-portal-head__intro {
  display: flex;
  flex-direction: column;
  gap: var(--zz-space-4);
}

.zz-portal-intro {
  margin: var(--zz-space-12) 0 0;
  max-width: 540px;
  font-family: var(--zz-font-body);
  font-size: var(--zz-text-body-1);
  line-height: var(--zz-leading-body-1);
  color: var(--zz-color-text);
}

.zz-portal-head__user {
  display: flex;
  justify-content: flex-end;
}

/* ── Logged-in user block ──────────────────────────────────────────────── */

.zz-user {
  display: flex;
  align-items: center;
  gap: var(--zz-space-8);
}

.zz-user__initials {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--zz-radius-full);
  background: var(--zz-secondary-300);
  font-family: var(--zz-font-body);
  font-size: var(--zz-text-body-1);
  line-height: var(--zz-leading-body-1);
  font-weight: var(--zz-weight-semibold);
  /* secondary-700 on secondary-300 — white would drop below 2:1 contrast. */
  color: var(--zz-secondary-700);
}

.zz-user__meta {
  display: flex;
  flex-direction: column;
  gap: var(--zz-space-2);
  min-width: 0;
}

.zz-user__name {
  font-family: var(--zz-font-body);
  font-size: var(--zz-text-body-1);
  line-height: var(--zz-leading-body-1);
  font-weight: var(--zz-weight-semibold);
  color: var(--zz-color-heading);
}

.zz-user__logout {
  font-family: var(--zz-font-body);
  font-size: var(--zz-text-body-1);
  line-height: var(--zz-leading-body-1);
  color: var(--zz-primary-700);
  text-decoration: none;
}

.zz-user__logout:hover,
.zz-user__logout:focus-visible {
  color: var(--zz-primary-500);
  text-decoration: underline;
}

/* ── Section tabs ──────────────────────────────────────────────────────── */
/* Bricks owns the markup, interaction and ARIA (tabs-nested). Only the look
   lives here, hung off Bricks' own classes — .brx-open is its active state. */

.brxe-tabs-nested .tab-menu {
  flex-direction: column;
  flex-wrap: nowrap;
  flex: 0 0 290px;
  /* Figma spaces the tabs 8px apart (instances at y 0, 56, 112 … on 48px). */
  gap: var(--zz-space-8);
}

.zz-jump-to {
  margin: 0 0 var(--zz-space-8);
  font-family: var(--zz-font-body);
  font-size: var(--zz-text-body-1);
  line-height: var(--zz-leading-body-1);
  font-weight: var(--zz-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--zz-color-heading);
}

.brxe-tabs-nested .tab-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--zz-space-8);
  width: 100%;
  padding: var(--zz-space-12);
  border-left: var(--zz-stroke-4) solid transparent;
  background: var(--zz-color-surface-soft);
  font-family: var(--zz-font-body);
  font-size: var(--zz-text-body-1);
  line-height: var(--zz-leading-body-1);
  color: var(--zz-color-text);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.brxe-tabs-nested .tab-title:hover {
  background: var(--zz-neutral-100);
}

.brxe-tabs-nested .tab-title.brx-open {
  background: var(--zz-color-surface);
  border-left-color: var(--zz-primary-700);
  /* Bricks bolds the open tab by default; the design only bolds the label. */
  font-weight: var(--zz-weight-regular);
}

.brxe-tabs-nested .tab-title.brx-open .zz-tab__label {
  font-weight: var(--zz-weight-semibold);
  color: var(--zz-color-heading);
}

.brxe-tabs-nested .tab-title:focus-visible {
  outline: var(--zz-stroke-2) solid var(--zz-primary-700);
  outline-offset: -2px;
}

.brxe-tabs-nested .tab-content {
  flex: 1 1 auto;
  min-width: 0;
}

/* Bricks 2.4.70 leaves non-active nested panes in the normal flow when the
   page's global block styles set display:flex. Keep only the active pane in
   the layout; Bricks toggles .brx-open when the dealer changes tabs. */
.brxe-tabs-nested .tab-content > .tab-pane:not(.brx-open) {
  display: none !important;
}

/* ── Panel header: group name left, count right (Figma 2279:4935) ──────── */

.zz-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--zz-space-16);
  padding-bottom: var(--zz-space-16);
  border-bottom: var(--zz-stroke-1) solid var(--zz-primary-700);
}

.zz-panel-head__type {
  font-family: var(--zz-font-body);
  font-size: var(--zz-text-body-1);
  line-height: var(--zz-leading-body-1);
  font-weight: var(--zz-weight-semibold);
  text-transform: uppercase;
  color: var(--zz-color-heading);
}

.zz-panel-head__qty {
  font-family: var(--zz-font-body);
  font-size: var(--zz-text-body-1);
  line-height: var(--zz-leading-body-1);
  text-transform: uppercase;
  color: var(--zz-color-text);
  white-space: nowrap;
}

/* ── Group callout (Figma 2279:4953) ───────────────────────────────────── */

.zz-note {
  display: flex;
  flex-direction: column;
  gap: var(--zz-space-8);
  margin-top: var(--zz-space-16);
  padding: var(--zz-space-16);
  background: var(--zz-secondary-100);
  color: var(--zz-secondary-700);
}

.zz-note__title {
  margin: 0;
  font-family: var(--zz-font-body);
  font-size: var(--zz-text-body-1);
  line-height: var(--zz-leading-body-1);
  font-weight: var(--zz-weight-semibold);
}

.zz-note__body {
  margin: 0;
  font-family: var(--zz-font-body);
  font-size: var(--zz-text-body-2);
  line-height: var(--zz-leading-body-2);
}

/* ── File table ────────────────────────────────────────────────────────── */

.zz-files {
  list-style: none;
  margin: 0;
  padding: 0;
}

.zz-file {
  display: flex;
  align-items: center;
  gap: var(--zz-space-16);
  min-height: 70px;
  padding: var(--zz-space-20) var(--zz-space-16);
  background: var(--zz-color-surface-soft);
  border-bottom: var(--zz-stroke-1) solid var(--zz-color-border);
}

.zz-file__badge {
  flex: 0 0 auto;
  min-width: 48px;
  padding: var(--zz-space-4) var(--zz-space-8);
  background: var(--zz-neutral-500);
  color: var(--zz-color-inverse);
  font-family: var(--zz-font-body);
  font-size: var(--zz-text-body-2);
  line-height: var(--zz-leading-body-2);
  font-weight: var(--zz-weight-semibold);
  text-align: center;
}

.zz-file__badge--pdf   { background: var(--zz-red-primary); }
.zz-file__badge--video { background: var(--zz-primary-700); }
.zz-file__badge--zip   { background: var(--zz-secondary-300); }

.zz-file__name {
  flex: 1 1 auto;
  /* min-width:0 lets this shrink below its content so the row can compress.
     Without a wrap rule the uppercase title then overflows its box and paints
     over the size and action columns, so force it to break instead. */
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--zz-font-body);
  font-size: var(--zz-text-body-1);
  line-height: var(--zz-leading-body-1);
  font-weight: var(--zz-weight-regular);
  color: var(--zz-color-heading);
}

.zz-file__size {
  flex: 0 0 auto;
  font-family: var(--zz-font-body);
  font-size: var(--zz-text-body-2);
  line-height: var(--zz-leading-body-2);
  color: var(--zz-color-text);
  white-space: nowrap;
}

/* A Bricks button element, stripped back to the link treatment the design
   uses. The icon rides along via the element's own icon control. */
.zz-file__action.bricks-button {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 130px;
  justify-content: flex-end;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--zz-font-body);
  font-size: var(--zz-text-body-1);
  line-height: var(--zz-leading-body-1);
  font-weight: var(--zz-weight-semibold);
  color: var(--zz-primary-700);
  text-decoration: none;
  white-space: nowrap;
}

.zz-file__action.bricks-button:hover,
.zz-file__action.bricks-button:focus-visible {
  background: none;
  color: var(--zz-primary-500);
  text-decoration: underline;
}

.zz-file__action i {
  font-size: 18px;
  line-height: 1;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .zz-portal-head {
    grid-template-columns: 1fr;
    gap: var(--zz-space-24);
    align-items: start;
  }

  .zz-portal-head__user {
    justify-content: flex-start;
  }

  /* Stack the menu above the panes and lay the tabs out as a row. */
  .brxe-tabs-nested {
    flex-direction: column !important;
  }

  .brxe-tabs-nested .tab-menu {
    flex: 0 0 auto;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .brxe-tabs-nested .tab-title {
    width: auto;
    border-left: 0;
    border-bottom: var(--zz-stroke-4) solid transparent;
  }

  .brxe-tabs-nested .tab-title.brx-open {
    border-left-color: transparent;
    border-bottom-color: var(--zz-primary-700);
  }
}

@media (max-width: 640px) {
  .zz-file {
    flex-wrap: wrap;
    gap: var(--zz-space-8) var(--zz-space-12);
    padding: var(--zz-space-16);
  }

  .zz-file__name {
    flex: 1 1 100%;
    order: 2;
  }

  .zz-file__size {
    order: 3;
  }

  .zz-file__action {
    order: 4;
    min-width: 0;
    margin-left: auto;
  }
}
