/* ==========================================================
   AYW DESIGN SYSTEM
   PAGES / SOCIAL / PROFILE

   Responsabilidades:
   - estrutura dos componentes de perfil;
   - identidade do usuário;
   - contadores sociais;
   - ações do perfil;
   - biografia e edição;
   - informações da conta;
   - resumo financeiro;
   - lista de movimentações;
   - responsividade específica do perfil.

   Aparência compartilhada vem de:
   - components/cards.css
   - components/avatars.css
   - components/buttons.css
   - components/forms.css
   - components/badges.css
   - components/empty-states.css

   Não utiliza Bootstrap.
   ========================================================== */


/* ==========================================================
   PÁGINA
   ========================================================== */

   .ayw-profile-page {
    display: flex;
    flex-direction: column;
  
    width: 100%;
    min-width: 0;
  
    gap: var(--ayw-space-3);
  }
  
  
  /* ==========================================================
     RESUMO DO PERFIL
     ========================================================== */
  
  .ayw-profile-summary {
    align-self: flex-start;

    width: 100%;
    min-width: 0;

    height: auto;
  
    overflow: hidden;
  }
  
  .ayw-profile-summary-body {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    justify-content: flex-start !important;
  
    width: 100%;
    min-width: 0;

    height: auto;
  
    gap: var(--ayw-space-3);
  }

  .ayw-profile-summary-body > * {
    flex: 0 0 auto;
  }
  
  
  /* ==========================================================
     IDENTIDADE
     ========================================================== */
  
  .ayw-profile-identity {
    display: flex;
    flex-direction: column;
  
    width: 100%;
    min-width: 0;
  
    gap: var(--ayw-space-3);
  }
  
  .ayw-profile-identity-main {
    display: flex;
    flex-direction: column;
    align-items: center;
  
    width: 100%;
    min-width: 0;
  
    gap: var(--ayw-space-2);
  
    text-align: center;
  }
  
  .ayw-profile-avatar {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
  
    width: 4.5rem;
    height: 4.5rem;
    min-width: 4.5rem;
    min-height: 4.5rem;
    max-width: 4.5rem;
    max-height: 4.5rem;
  
    overflow: hidden;
  
    border-radius: 50%;
  }
  
  .ayw-profile-avatar img {
    display: block;
  
    width: 100%;
    height: 100%;
  
    object-fit: cover;
  }
  
  .ayw-profile-heading {
    width: 100%;
    min-width: 0;
  
    overflow: hidden;
  }
  
  .ayw-profile-name {
    width: 100%;
    max-width: 100%;
  
    margin: 0;
  
    overflow: hidden;
  
    color: var(--ayw-text);
  
    font-size: var(--ayw-font-size-lg);
    font-weight: var(--ayw-font-weight-semibold);
    line-height: var(--ayw-line-height-tight);
  
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .ayw-profile-handle {
    display: block;
  
    width: 100%;
    min-width: 0;
    max-width: 100%;
  
    margin-top: var(--ayw-space-1);
  
    overflow: hidden;
  
    color: var(--ayw-text-muted);
  
    font-size: var(--ayw-font-size-xs);
    line-height: var(--ayw-line-height-normal);
  
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  
  /* ==========================================================
     CONTADORES
     ========================================================== */
  
  .ayw-profile-stats {
    display: grid;
  
    grid-template-columns:
      repeat(
        3,
        minmax(0, 1fr)
      );
  
    width: 100%;
    min-width: 0;
  
    gap: var(--ayw-space-1);
  }
  
  .ayw-profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  
    min-width: 0;
    min-height: 3.5rem;
  
    gap: var(--ayw-space-1);
  
    padding:
      var(--ayw-space-2)
      0.25rem;
  
    border-radius: var(--ayw-radius-md);
  
    color: inherit;
  
    text-align: center;
    text-decoration: none;
  
    -webkit-tap-highlight-color: transparent;
  
    transition:
      background-color var(--ayw-transition-fast),
      color var(--ayw-transition-fast);
  }
  
  a.ayw-profile-stat:hover {
    background: var(--ayw-bg-muted);
    color: var(--ayw-primary);
  
    text-decoration: none;
  }
  
  a.ayw-profile-stat:focus-visible {
    outline: 3px solid var(--ayw-focus-ring);
    outline-offset: 2px;
  }
  
  .ayw-profile-stat-value,
  .ayw-profile-stat-label {
    display: block;
  
    width: 100%;
    min-width: 0;
    max-width: 100%;
  
    text-align: center;
  }
  
  .ayw-profile-stat-value {
    overflow: hidden;
  
    color: var(--ayw-text);
  
    font-size: var(--ayw-font-size-md);
    font-weight: var(--ayw-font-weight-semibold);
    line-height: 1;
  
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .ayw-profile-stat-label {
    color: var(--ayw-text-muted);
  
    font-size: 0.5625rem;
    line-height: 1.15;
    letter-spacing: 0.025em;
  
    overflow-wrap: anywhere;
    text-transform: uppercase;
  }
  
  a.ayw-profile-stat:hover .ayw-profile-stat-value,
  a.ayw-profile-stat:hover .ayw-profile-stat-label {
    color: inherit;
  }
  
  
  /* ==========================================================
     AÇÕES
     ========================================================== */
  
  .ayw-profile-actions {
    display: grid;
  
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );
  
    width: 100%;
    min-width: 0;
  
    gap: var(--ayw-space-2);
  }
  
  .ayw-profile-actions form {
    width: 100%;
    min-width: 0;
  
    margin: 0;
  }
  
  .ayw-profile-action {
    width: 100%;
    min-width: 0;
  }
  
  
  /* ==========================================================
     DIVISÃO
     ========================================================== */
  
  .ayw-profile-divider {
    width: 100%;
    height: 1px;
  
    margin: 0;
  
    border: 0;
  
    background: var(--ayw-border);
  }
  
  
  /* ==========================================================
     BIOGRAFIA
     ========================================================== */
  
  .ayw-profile-about {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  
    width: 100%;
    min-width: 0;
  
    gap: var(--ayw-space-2);
  
    text-align: left;
  }
  
  .ayw-profile-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  
    width: 100%;
    min-width: 0;
  
    gap: var(--ayw-space-2);
  
    margin: 0;
  }
  
  .ayw-profile-section-title {
    min-width: 0;
  
    margin: 0;
  
    color: var(--ayw-text);
  
    font-size: var(--ayw-font-size-sm);
    font-weight: var(--ayw-font-weight-semibold);
    line-height: var(--ayw-line-height-normal);
  
    text-align: left;
  }
  
  .ayw-profile-edit-button {
    flex: 0 0 auto;
  }
  
  .ayw-profile-bio {
    display: inline-block !important;
    flex: 0 0 auto !important;
    align-self: flex-start !important;
  
    width: auto !important;
    min-width: 0;
    max-width: 100%;

    height: auto !important;
    min-height: 0 !important;
  
    margin: 0;

    padding: 0;

    border: 0;
    border-radius: 0;

    background: transparent !important;
  
    color: var(--ayw-text-soft);
  
    font-size: var(--ayw-font-size-sm);
    line-height: var(--ayw-line-height-relaxed);
  
    text-align: left !important;
  
    overflow-wrap: anywhere;
    white-space: normal;
  }
  
  .ayw-profile-empty-text {
    color: var(--ayw-text-muted);
  
    font-style: italic;
  }
  
  .ayw-profile-bio-editor {
    width: 100%;
    min-width: 0;
  
    margin-top: var(--ayw-space-1);
  }
  
  .ayw-profile-bio-editor[hidden] {
    display: none !important;
  }

  .ayw-profile-about.is-editing .ayw-profile-bio {
    display: none !important;
  }

  .ayw-profile-about.is-editing .ayw-profile-bio-editor {
    display: block !important;
  }

  .ayw-profile-about.is-editing .ayw-profile-bio-editor form,
  .ayw-profile-about.is-editing .ayw-profile-bio-editor .ayw-field,
  .ayw-profile-about.is-editing .ayw-profile-bio-editor .ayw-textarea,
  .ayw-profile-about.is-editing .ayw-profile-bio-actions {
    visibility: visible;
  }

  .ayw-social-home-sidebar-inner.is-editing-bio {
    position: static;

    max-height: none;

    overflow: visible;
  }
  
  .ayw-profile-bio-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
  
    width: 100%;
    min-width: 0;
  
    gap: var(--ayw-space-2);
  
    margin-top: var(--ayw-space-2);
  }
  
  .ayw-profile-bio-actions form {
    margin: 0;
  }
  
  
  /* ==========================================================
     INFORMAÇÕES DA CONTA
     ========================================================== */
  
  .ayw-profile-account-meta {
    display: grid;
  
    grid-template-columns:
      minmax(0, 1fr);
  
    width: 100%;
    min-width: 0;
  
    gap: var(--ayw-space-2);
  
    margin: 0 !important;
  }
  
  .ayw-profile-account-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  
    min-width: 0;
  
    gap:
      var(--ayw-space-1)
      var(--ayw-space-2);
  }
  
  .ayw-profile-account-label,
  .ayw-profile-account-value {
    margin: 0;
  }
  
  .ayw-profile-account-label {
    flex: 0 0 auto;
  
    color: var(--ayw-text-muted);
  
    font-size: var(--ayw-font-size-xs);
    font-weight: var(--ayw-font-weight-medium);
    line-height: var(--ayw-line-height-normal);
    letter-spacing: 0.03em;
  
    text-transform: uppercase;
  }
  
  .ayw-profile-account-value {
    min-width: 0;
  
    color: var(--ayw-text-soft);
  
    font-size: var(--ayw-font-size-sm);
    line-height: var(--ayw-line-height-normal);
  
    overflow-wrap: anywhere;
  }
  
  
  /* ==========================================================
     FINANÇAS
     ========================================================== */
  
  .ayw-profile-finance {
    width: 100%;
    min-width: 0;
  
    overflow: hidden;
  }
  
  .ayw-profile-finance-header {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
  
    width: 100%;
    min-width: 0;
  
    gap: var(--ayw-space-3);
  }
  
  .ayw-profile-finance-heading {
    display: flex;
    align-items: center;
  
    flex: 1 1 auto;
  
    min-width: 0;
  
    gap: var(--ayw-space-2);
  }
  
  .ayw-profile-finance-heading .ayw-card-title {
    min-width: 0;
  
    margin: 0;
  
    overflow: hidden;
  
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .ayw-profile-finance-link {
    display: inline-flex;
    align-items: center;
  
    flex: 0 0 auto;
  
    gap: var(--ayw-space-1);
  
    white-space: nowrap;
  }
  
  .ayw-profile-finance-body {
    width: 100%;
    min-width: 0;
  }
  
  
  /* ==========================================================
     MÉTRICAS FINANCEIRAS
     ========================================================== */
  
  .ayw-profile-finance-metrics {
    display: grid;
  
    grid-template-columns:
      repeat(
        3,
        minmax(0, 1fr)
      );
  
    width: 100%;
    min-width: 0;
  
    gap: var(--ayw-space-2);
  }
  
  .ayw-profile-finance-metric {
    display: flex;
    flex-direction: column;
  
    min-width: 0;
  
    gap: var(--ayw-space-1);
  
    padding:
      var(--ayw-space-2)
      var(--ayw-space-1);
  
    border-radius: var(--ayw-radius-md);
  
    background: var(--ayw-bg-soft);
  }
  
  .ayw-profile-finance-metric-label,
  .ayw-profile-finance-metric-value {
    display: block;
  
    width: 100%;
    min-width: 0;
    max-width: 100%;
  
    overflow: hidden;
  
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .ayw-profile-finance-metric-label {
    color: var(--ayw-text-muted);
  
    font-size: 0.5625rem;
    line-height: var(--ayw-line-height-normal);
    letter-spacing: 0.025em;
  
    text-transform: uppercase;
  }
  
  .ayw-profile-finance-metric-value {
    color: var(--ayw-text);
  
    font-size: var(--ayw-font-size-sm);
    font-weight: var(--ayw-font-weight-semibold);
    line-height: var(--ayw-line-height-tight);
  }
  
  
  /* ==========================================================
     LISTA FINANCEIRA
     ========================================================== */
  
  .ayw-profile-finance-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  
    width: 100%;
    min-width: 0;
  
    gap: var(--ayw-space-2);
  
    margin-top: var(--ayw-space-3);
    margin-bottom: var(--ayw-space-1);
  }
  
  .ayw-profile-finance-list-title {
    min-width: 0;
  
    margin: 0;
  
    color: var(--ayw-text);
  
    font-size: var(--ayw-font-size-sm);
    font-weight: var(--ayw-font-weight-semibold);
    line-height: var(--ayw-line-height-normal);
  }
  
  .ayw-profile-finance-list {
    display: flex;
    flex-direction: column;
  
    width: 100%;
    min-width: 0;
    max-height: none;
  
    margin: 0;
    padding: 0;
  
    overflow: visible;
  
    list-style: none;
  }
  
  .ayw-profile-finance-item {
    display: grid;
  
    grid-template-columns:
      minmax(0, 1fr)
      minmax(5.5rem, auto);
  
    align-items: start;
  
    width: 100%;
    min-width: 0;
  
    gap: var(--ayw-space-2);
  
    padding-block: var(--ayw-space-2);
  
    border-bottom: 1px solid var(--ayw-border);
  }
  
  .ayw-profile-finance-item:last-child {
    padding-bottom: 0;
  
    border-bottom: 0;
  }
  
  .ayw-profile-finance-item-main {
    min-width: 0;
  }
  
  .ayw-profile-finance-ticker {
    display: block;
  
    max-width: 100%;
  
    overflow: hidden;
  
    color: var(--ayw-text);
  
    font-size: var(--ayw-font-size-sm);
    font-weight: var(--ayw-font-weight-semibold);
    line-height: var(--ayw-line-height-tight);
  
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .ayw-profile-finance-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  
    min-width: 0;
  
    gap:
      var(--ayw-space-1)
      var(--ayw-space-2);
  
    margin-top: var(--ayw-space-1);
  
    color: var(--ayw-text-muted);
  
    font-size: var(--ayw-font-size-xs);
    line-height: var(--ayw-line-height-normal);
  }
  
  .ayw-profile-finance-values {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  
    min-width: 0;
  
    gap: var(--ayw-space-1);
  
    text-align: right;
  }
  
  .ayw-profile-finance-amount,
  .ayw-profile-finance-price {
    display: block;
  
    max-width: 100%;
  
    overflow: hidden;
  
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .ayw-profile-finance-amount {
    color: var(--ayw-text);
  
    font-size: var(--ayw-font-size-sm);
    font-weight: var(--ayw-font-weight-semibold);
    line-height: var(--ayw-line-height-tight);
  }
  
  .ayw-profile-finance-price {
    color: var(--ayw-text-muted);
  
    font-size: var(--ayw-font-size-xs);
    line-height: var(--ayw-line-height-normal);
  }
  
  
  /* ==========================================================
     CONTEXTO DA SIDEBAR SOCIAL
     ========================================================== */
  
  .ayw-social-home-sidebar .ayw-profile-page {
    gap: var(--ayw-space-3);
  }
  
  .ayw-social-home-sidebar .ayw-profile-summary-body {
    justify-content: flex-start;
  
    gap: var(--ayw-space-3);
  }
  
  .ayw-social-home-sidebar .ayw-profile-identity {
    display: flex;
    flex-direction: column;
  
    gap: var(--ayw-space-3);
  }
  
  .ayw-social-home-sidebar .ayw-profile-identity-main {
    display: flex;
    flex-direction: column;
    align-items: center;
  
    gap: var(--ayw-space-2);
  
    text-align: center;
  }
  
  .ayw-social-home-sidebar .ayw-profile-avatar {
    width: 4.5rem;
    height: 4.5rem;
    min-width: 4.5rem;
    min-height: 4.5rem;
    max-width: 4.5rem;
    max-height: 4.5rem;
  }
  
  .ayw-social-home-sidebar .ayw-profile-heading {
    width: 100%;
  }
  
  .ayw-social-home-sidebar .ayw-profile-stats {
    width: 100%;
  
    grid-template-columns:
      repeat(
        3,
        minmax(0, 1fr)
      );
  }
  
  .ayw-social-home-sidebar .ayw-profile-about {
    align-items: stretch;
  
    text-align: left;
  }
  
  .ayw-social-home-sidebar .ayw-profile-bio {
    width: auto !important;
    height: auto !important;

    text-align: left !important;
  }
  
  .ayw-social-home-sidebar .ayw-profile-account-meta {
    grid-template-columns:
      minmax(0, 1fr);
  }
  
  .ayw-social-home-sidebar .ayw-profile-actions {
    display: grid;
  
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );
  }
  
  .ayw-social-home-sidebar .ayw-profile-actions form,
  .ayw-social-home-sidebar .ayw-profile-action {
    width: 100%;
  }
  
  
  /* ==========================================================
     ÁREAS LARGAS FORA DA SIDEBAR
     ========================================================== */
  
  @media (min-width: 48rem) {
    .ayw-profile-page {
      gap: var(--ayw-space-4);
    }
  
    .ayw-profile-page.is-wide .ayw-profile-identity {
      display: grid;
  
      grid-template-columns:
        minmax(0, 1fr)
        minmax(18rem, 0.7fr);
  
      align-items: center;
    }
  
    .ayw-profile-page.is-wide .ayw-profile-identity-main {
      display: grid;
  
      grid-template-columns:
        auto
        minmax(0, 1fr);
  
      align-items: center;
  
      text-align: left;
    }
  
    .ayw-profile-page.is-wide .ayw-profile-avatar {
      width: 4.5rem;
      height: 4.5rem;
    }
  
    .ayw-profile-page.is-wide .ayw-profile-name,
    .ayw-profile-page.is-wide .ayw-profile-handle {
      text-align: left;
    }
  
    .ayw-profile-page.is-wide .ayw-profile-actions {
      display: flex;
      flex-wrap: wrap;
    }
  
    .ayw-profile-page.is-wide .ayw-profile-actions form,
    .ayw-profile-page.is-wide .ayw-profile-action {
      width: auto;
    }
  
    .ayw-profile-page.is-wide .ayw-profile-account-meta {
      grid-template-columns:
        repeat(
          2,
          minmax(0, 1fr)
        );
    }
  }
  
  
  /* ==========================================================
     CELULAR
     ========================================================== */
  
  @media (max-width: 35.999rem) {
    .ayw-profile-finance-header {
      align-items: center;
      flex-direction: row;
    }
  
    .ayw-profile-finance-list-header {
      align-items: flex-start;
    }
  
    .ayw-profile-finance-item {
      grid-template-columns:
        minmax(0, 1fr);
    }
  
    .ayw-profile-finance-values {
      align-items: flex-start;
  
      width: 100%;
  
      text-align: left;
    }
  }
  
  
  /* ==========================================================
     CELULAR MUITO ESTREITO
     ========================================================== */
  
  @media (max-width: 23.4375rem) {
    .ayw-profile-summary-body {
      gap: var(--ayw-space-3);
    }
  
    .ayw-profile-stats {
      gap: 0;
    }
  
    .ayw-profile-stat {
      min-height: 3.25rem;
  
      padding-inline: 0;
    }
  
    .ayw-profile-stat-value {
      font-size: var(--ayw-font-size-sm);
    }
  
    .ayw-profile-stat-label {
      font-size: 0.5rem;
      letter-spacing: 0.01em;
    }
  
    .ayw-profile-actions {
      grid-template-columns:
        minmax(0, 1fr);
    }
  
    .ayw-profile-section-header {
      align-items: center;
    }
  
    .ayw-profile-bio-actions {
      align-items: stretch;
      flex-direction: column;
    }
  
    .ayw-profile-bio-actions .ayw-btn {
      width: 100%;
    }
  
    .ayw-profile-finance-header {
      align-items: flex-start;
      flex-direction: column;
    }
  
    .ayw-profile-finance-link {
      align-self: flex-start;
    }
  
    .ayw-profile-finance-metrics {
      grid-template-columns:
        minmax(0, 1fr);
  
      gap: var(--ayw-space-2);
    }
  
    .ayw-profile-finance-list-header {
      flex-direction: column;
  
      gap: var(--ayw-space-2);
    }
  
    .ayw-profile-finance-item {
      grid-template-columns:
        minmax(0, 1fr);
    }
  
    .ayw-profile-finance-values {
      align-items: flex-start;
  
      text-align: left;
    }
  }
  
  
  /* ==========================================================
     MOVIMENTO REDUZIDO
     ========================================================== */
  
  @media (prefers-reduced-motion: reduce) {
    .ayw-profile-stat {
      transition: none;
    }
  }
