/* Loaded after page styles so mobile behavior survives legacy page overrides. */
.auth-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}
.auth-card {
  width: min(100%, 28rem);
  padding: clamp(1.25rem, 5vw, 2rem);
  border: 1px solid var(--border-color, #34332e);
  border-radius: 1rem;
  background: var(--bg-card, #171918);
  overflow-wrap: anywhere;
}
.auth-card h1 {
  font-size: clamp(1.6rem, 6vw, 2rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}
.auth-card form {
  display: grid;
  gap: 0.75rem;
  margin-block: 1.5rem;
}
.auth-card form .btn {
  width: 100%;
  margin-top: 0.5rem;
}
.auth-card > p + p {
  margin-top: 0.75rem;
}

@media (max-width: 768px) {
  /* Sixteen pixel inputs prevent automatic zoom when typing on iOS. */
  body input:not([type='checkbox']):not([type='radio']):not([type='hidden']),
  body select,
  body textarea {
    min-width: 0;
    max-width: 100%;
    font-size: 16px !important;
  }
  body
    input:not([type='checkbox']):not([type='radio']):not([type='hidden']):not(
      [type='color']
    ):not([type='range']),
  body select {
    min-height: 44px;
  }
  body .btn,
  body .button,
  body .btn-icon,
  body .modal-close,
  body .theme-toggle,
  body .navbar__toggle,
  body .password-toggle,
  body .tab {
    min-height: 44px;
  }
  body .btn-icon,
  body .modal-close,
  body .navbar__toggle,
  body .password-toggle {
    min-width: 44px;
  }
  body .btn,
  body .button {
    white-space: normal;
  }
  .auth-card .form-input {
    width: 100%;
  }

  /* Booking: reserve the screen for choices and show complete step labels. */
  .booking-container {
    width: calc(100% - 1.5rem);
    padding: 0 0 calc(2rem + env(safe-area-inset-bottom));
  }
  .booking-header {
    padding: 6.5rem 1rem 1.5rem;
  }
  .booking-container .step-progress {
    margin-bottom: 1.25rem;
    padding: 1rem 0.25rem;
  }
  .booking-container .step-label {
    max-width: none;
    font-size: 0.6875rem;
    line-height: 1.3;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .booking-container .progress-line,
  .booking-container .progress-line-active {
    top: 2rem;
  }
  .booking-container .wizard-card {
    padding: 1.25rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
  }
  .booking-container .selection-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }
  .booking-container .select-card {
    padding: 1rem;
  }
  .booking-container .step-desc {
    margin-bottom: 1.25rem;
  }
  .booking-container .wizard-actions {
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
  }
  .booking-container .wizard-actions .btn {
    flex: 1;
    min-width: 0;
  }
  .booking-container .logged-user-bar {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
  }
  .rewards__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .points-card {
    padding: 1.5rem;
    margin-bottom: 2rem;
  }
  .reward-card {
    padding: 1.25rem;
  }
  .billing-status,
  .billing-plan,
  .billing-pix {
    padding: 1.25rem;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .billing-actions {
    width: 100%;
  }
  .billing-actions .btn {
    flex: 1 1 100%;
  }

  /* The product demo reflows instead of requiring a desktop-width canvas. */
  .dashboard-stage {
    width: calc(100% - 1.5rem);
    overflow: visible;
  }
  .dashboard-stage .dashboard-window {
    min-width: 0;
    transform: none !important;
  }
  .dashboard-stage .dashboard-topbar {
    height: auto;
    min-height: 4rem;
    padding: 0.75rem;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
  }
  .dashboard-stage .dashboard-search {
    display: none;
  }
  .dashboard-stage .dashboard-account > button,
  .dashboard-stage .dashboard-account div {
    display: none;
  }
  .dashboard-stage .dashboard-layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  .dashboard-stage .dashboard-sidebar {
    padding: 0.5rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .dashboard-stage .dashboard-sidebar nav {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }
  .dashboard-stage .dashboard-sidebar nav button {
    width: auto;
    min-height: 44px;
    flex: 0 0 auto;
  }
  .dashboard-stage .sidebar-help,
  .dashboard-stage .sidebar-settings {
    display: none;
  }
  .dashboard-stage .product-screen {
    padding: 1rem;
  }
  .dashboard-stage .screen-header {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .dashboard-stage .screen-header button,
  .dashboard-stage .retention-card button {
    min-height: 44px;
    font-size: 0.8125rem;
  }
  .dashboard-stage .metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .dashboard-stage .metric-grid article {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .dashboard-stage .metric-grid article > span,
  .dashboard-stage .metric-grid small {
    font-size: 0.8125rem;
  }
  .dashboard-stage .overview-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .dashboard-stage .dashboard-caption {
    position: static;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
  }
  .dashboard-stage .screen-controls {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
  }
  .dashboard-stage .screen-controls button {
    min-height: 44px;
  }
  .dashboard-stage .team-demo-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }
  .dashboard-stage .team-demo-summary {
    grid-template-columns: minmax(0, 1fr);
  }
  .dashboard-stage .team-demo-table-wrap {
    overflow-x: auto;
  }

  /* Keep sheets usable with a short screen and the on-screen keyboard. */
  body > .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  body > .modal-overlay .modal {
    max-height: calc(100dvh - max(1rem, env(safe-area-inset-top)));
    width: 100%;
    min-width: 0;
  }
  body > .modal-overlay .modal-header {
    flex-shrink: 0;
    gap: 0.75rem;
  }
  body > .modal-overlay .modal-title {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  body > .modal-overlay .modal-body {
    min-height: 0;
    overscroll-behavior: contain;
  }
  body > .modal-overlay .modal-footer {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
  body > .modal-overlay .modal-footer .btn {
    flex: 1 1 8rem;
  }
  .table-pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
  .dashboard-app .mobile-app-bar {
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }
  .dashboard-app .mobile-app-title {
    max-width: 7rem;
    font-size: 0.75rem;
    overflow-wrap: anywhere;
  }
  .dashboard-app .dashboard-date-control {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }
  .dashboard-app .page-section,
  .dashboard-app .section-block {
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .birthday-filters-bar .btn-group {
    width: 100%;
    flex-wrap: wrap;
  }
  .birthday-filters-bar .btn-group .btn {
    flex: 1 1 8rem;
  }
  .birthday-filters-bar > div {
    min-width: 0;
    max-width: 100%;
  }
  .dashboard-app .overview-table table {
    min-width: 0;
    table-layout: fixed;
  }
  .overview-table summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 0.8125rem;
  }
  .dashboard-app .team-table-wrap,
  .dashboard-app .catalog-table-scroll {
    overflow: visible;
    padding: 0.75rem;
  }
  .dashboard-app .page-section table.responsive-table td::before {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
  }
  .dashboard-app .page-section table.responsive-table td[colspan]::before {
    content: none;
  }
  .dashboard-app .page-section table.responsive-table td:first-child {
    text-align: left;
  }
  .dashboard-app .team-table td:first-child::before,
  .dashboard-app .catalog-table td:first-child::before {
    content: none;
  }
  .dashboard-app .team-table .team-actions {
    flex: 1;
    flex-wrap: wrap;
  }
  .dashboard-app .team-profile {
    padding-top: 0;
  }
  .dashboard-app .team-profile summary {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .dashboard-app .catalog-table .catalog-product {
    min-width: 0;
    max-width: 100%;
  }
  .dashboard-app .catalog-table .catalog-actions::before {
    margin-right: auto;
  }
  .dashboard-app .page-section table.responsive-table tr[hidden] {
    display: none;
  }
}

@media (max-width: 768px) {
  /* Page-specific desktop rules must not constrain card rows or their actions. */
  .dashboard-app #sectionProdutos .catalog-table td,
  .dashboard-app #sectionClientes .clients-table td.actions-cell {
    display: flex;
    padding: 0.8rem;
    height: auto;
    min-height: 3rem;
  }
  .dashboard-app #sectionProdutos .catalog-table td:first-child {
    min-height: 5rem;
  }
  .dashboard-app #sectionProdutos .catalog-actions .btn,
  .dashboard-app #sectionClientes .client-row-actions .btn,
  .dashboard-app .dashboard-team .team-edit {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}

/* Reward pages share the theme tokens; hardcoded white disappears in light mode. */
.points-card__title,
.points-card__desc,
.reward-card__desc,
.reward-card__cost span {
  color: var(--color-text-secondary);
}
.points-card,
.reward-card {
  background: var(--color-surface);
  border-color: var(--color-border);
}
.btn-redeem {
  background: var(--color-accent-soft);
  border-color: var(--color-border-accent);
  color: var(--color-text);
}
.btn-redeem:hover {
  background: var(--color-surface-hover);
}

@media (max-width: 768px) {
  .profile__container {
    width: 100%;
    padding-inline: 1rem;
    gap: 1rem;
  }
  .profile__container .summary-card,
  .profile__container .form-card {
    padding: 1.25rem;
  }
  .profile__container .form-title {
    margin-bottom: 1.25rem;
  }
  .profile__container .privacy-grid {
    gap: 1rem;
  }
  .profile__container .profile-tab-btn {
    min-height: 44px;
  }
  .profile__container .privacy-grid label:has(input[type='checkbox']) {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .dashboard-app .page-section table.responsive-table td {
    height: auto;
    font-size: 0.875rem;
  }
}

@media (max-width: 768px) {
  /* A translated fixed drawer was extending the page below its real content. */
  .sidebar:not(.open) {
    display: none;
  }
  .sidebar.open {
    display: flex;
  }
}

@media (max-width: 768px) {
  #sectionAgenda #filterStatus {
    font-size: 16px !important;
  }
}

@media (max-width: 768px) {
  .platform-main > .platform-mobile-brand {
    width: fit-content;
    max-width: calc(100% - 4.75rem);
  }
  .platform-main .table-container {
    overflow: visible;
    border: 0;
  }
  :is(.platform-main, .dashboard-stage) table.responsive-table,
  :is(.platform-main, .dashboard-stage) table.responsive-table tbody {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  :is(.platform-main, .dashboard-stage) table.responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  :is(.platform-main, .dashboard-stage) table.responsive-table tbody {
    display: grid;
    gap: 1rem;
  }
  :is(.platform-main, .dashboard-stage) table.responsive-table tr {
    display: block;
    min-width: 0;
    border: 1px solid var(--color-border, var(--line));
    border-radius: 0.75rem;
    background: var(--color-surface, var(--panel));
  }
  :is(.platform-main, .dashboard-stage) table.responsive-table td {
    height: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem;
    border-bottom: 1px solid var(--color-border, var(--line));
    min-width: 0;
    text-align: right;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
  }
  :is(.platform-main, .dashboard-stage) table.responsive-table td:last-child {
    border-bottom: 0;
  }
  :is(.platform-main, .dashboard-stage) table.responsive-table td::before {
    content: attr(data-label);
    flex: 0 0 40%;
    color: var(--color-text-secondary, #b7b5af);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: left;
  }
  :is(.platform-main, .dashboard-stage) table.responsive-table td[colspan]::before {
    content: none;
  }
  :is(.platform-main, .dashboard-stage) table.responsive-table td > * {
    min-width: 0;
    max-width: 100%;
  }
  :is(.platform-main, .dashboard-stage) table.responsive-table .btn {
    min-height: 44px;
    white-space: normal;
  }
  .platform-main .platform-form-card .btn-primary {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .dashboard-stage .dashboard-sidebar nav button {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8125rem;
  }
  .dashboard-stage .dashboard-sidebar nav button span {
    display: inline;
    white-space: nowrap;
  }
  .dashboard-stage .team-demo-table-wrap {
    overflow: visible;
    padding: 0.75rem;
  }
  .dashboard-stage .team-demo-table tr[hidden] {
    display: none;
  }
  .dashboard-stage .team-demo-profile summary {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .dashboard-stage .team-demo-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .dashboard-stage .team-demo-toolbar input,
  .dashboard-stage .team-demo-toolbar select {
    width: 100%;
    max-width: none;
  }
  .dashboard-stage .calendar-board {
    overflow-x: auto;
  }
  .dashboard-stage .calendar-head,
  .dashboard-stage .calendar-body {
    min-width: 36rem;
  }
  .dashboard-stage .client-table > header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .dashboard-stage .table-row {
    grid-template-columns: minmax(0, 1fr) auto;
    font-size: 0.8125rem;
    padding: 1rem;
    gap: 0.75rem;
  }
  .dashboard-stage .table-row.table-label {
    display: none;
  }
  .dashboard-stage .table-row > span:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .booking-container .step-label {
    text-transform: none;
    font-weight: 600;
  }
}

@media (max-width: 768px) {
  .platform-main .form-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .platform-main .form-group {
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .platform-main .shop-cell-value {
    flex: 1 1 50%;
    display: grid;
    gap: 0.25rem;
  }
  .platform-main .shop-cell-value br {
    display: none;
  }
  .platform-main .shop-row-actions {
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .platform-main .shop-row-actions .btn {
    justify-content: center;
    width: 100%;
  }
}
