/* ==========================================================================
   Account page frame (#/accounts/<id>, audit Etap 6.2)
   js/views/account-page.js. Breadcrumb, the account's identity and the tabs
   into the rest of the app. The content under it is the single-account
   Dashboard, styled by dashboard.css and unchanged.
   --acct is the account's colour token (identity, never direction).
   ========================================================================== */

.acct-page-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.acct-crumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-footnote);
  color: var(--color-text-tertiary);
}

.acct-crumb a {
  color: var(--color-accent);
  font-weight: var(--fw-medium);
  text-decoration: none;
}

.acct-crumb a:hover {
  text-decoration: underline;
}

.acct-crumb [aria-current] {
  color: var(--color-text-secondary);
}

.acct-id {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Initials on a tint of the account's colour; the name beside it carries the
   meaning, so the badge is decorative (aria-hidden) and reads in every
   palette, the monochrome one included. */
.acct-id__badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--acct) 20%, var(--color-surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--acct) 45%, transparent);
  color: var(--color-text-primary);
  font-size: var(--fs-callout);
  font-weight: var(--fw-bold);
  letter-spacing: 0.02em;
}

.acct-id__text {
  min-width: 0;
  flex: 1 1 auto;
}

.acct-id__name {
  font-family: var(--font-family-display);
  font-size: var(--fs-large);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--color-text-primary);
  overflow-wrap: anywhere;
}

.acct-id__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-1);
  font-size: var(--fs-footnote);
  color: var(--color-text-secondary);
}

.acct-id__controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.acct-id__edit {
  text-decoration: none;
}

/* Tabs: links into the account's other sections. The current one is marked
   with the account's colour under it. */
.acct-tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  scrollbar-width: none;
}

.acct-tabs::-webkit-scrollbar {
  display: none;
}

.acct-tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-3);
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  color: var(--color-text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard);
}

.acct-tabs__tab:hover {
  color: var(--color-text-primary);
}

.acct-tabs__tab.is-active {
  color: var(--color-text-primary);
  font-weight: var(--fw-semibold);
  border-bottom-color: var(--acct);
}

.acct-tabs__count {
  font-size: var(--fs-caption);
  color: var(--color-text-tertiary);
}

/* Etap 7.3: the account's colour lives on its badge - two orbit rings in it
   around the initials (the balance is on the page now, not in a card). */
.acct-id__badge {
  position: relative;
  margin: 12px;
}

.acct-id__badge::before,
.acct-id__badge::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.acct-id__badge::before {
  inset: -9px;
  border: 1px solid color-mix(in srgb, var(--acct) 35%, transparent);
}

.acct-id__badge::after {
  inset: -15px;
  border: 1px dashed color-mix(in srgb, var(--acct) 22%, transparent);
}

.acct-crumb {
  font-family: var(--font-family-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.acct-id__meta span:not([aria-hidden]) {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  font-family: var(--font-family-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.acct-id__meta span[aria-hidden] {
  display: none;
}

@media (max-width: 700px) {
  .acct-page-head {
    gap: var(--space-3);
  }

  .acct-id {
    gap: var(--space-3);
  }

  .acct-id__badge {
    width: 40px;
    height: 40px;
    font-size: var(--fs-body);
  }

  .acct-id__name {
    font-size: var(--fs-title2);
  }

  /* Controls take their own full-width row under the name on a phone, laid
     out like the old view toolbar: one line, the period pill shrinking
     (it scrolls) rather than wrapping when it opens. Edit stays on the
     name's row. */
  .acct-id__controls {
    order: 1;
    flex-basis: 100%;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: var(--space-3);
  }

  .acct-id__controls [data-range-toggle] {
    min-width: 0;
  }

  .acct-crumb a,
  .acct-id__edit {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .acct-crumb {
    margin-bottom: calc(-1 * var(--space-3));
  }
}
