/* MOBILE_FORMS_V1_START */
@media (max-width: 768px) {
  html,
  body {
    overscroll-behavior: none;
  }

  body {
    min-height: 100dvh;
  }

  body.mobile-modal-open {
    overflow: hidden;
    touch-action: none;
  }

  .content {
    padding: 14px;
  }

  body.mobile-dashboard-active .content {
    padding: 14px;
  }

  body.mobile-dashboard-active .tab-panel.active {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  body.mobile-dashboard-active #tab-dashboard > .panel-header {
    display: none;
  }

  body.mobile-dashboard-active .dashboard-hero,
  body.mobile-dashboard-active .dashboard-focus-grid,
  body.mobile-dashboard-active .dashboard-stats-grid,
  body.mobile-dashboard-active .dashboard-shortcuts-grid,
  body.mobile-dashboard-active .dashboard-shortcuts-grid-featured {
    grid-template-columns: 1fr;
  }

  body.mobile-dashboard-active .dashboard-hero-main,
  body.mobile-dashboard-active .dashboard-focus-card,
  body.mobile-dashboard-active .dashboard-shortcuts-card,
  body.mobile-dashboard-active .dashboard-hero-side {
    border-radius: 22px;
  }

  body.mobile-dashboard-active .dashboard-hero-main {
    padding: 20px;
  }

  body.mobile-dashboard-active .dashboard-hero-actions,
  body.mobile-dashboard-active .dashboard-shortcut-card {
    flex-direction: column;
    align-items: flex-start;
  }

  body.mobile-dashboard-active .dashboard-shortcut-card {
    min-height: 0;
    padding: 18px 18px 18px 20px;
    gap: 12px;
  }

  body.mobile-dashboard-active .dashboard-shortcut-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    flex-basis: 54px;
  }

  body.mobile-dashboard-active .dashboard-shortcut-icon svg {
    width: 26px;
    height: 26px;
  }

  .subscription-brand-banner {
    padding: 12px 14px;
    border-radius: 18px;
  }

  .subscription-brand-banner-compact {
    margin-bottom: 14px;
    padding: 10px 12px;
  }

  .subscription-brand-banner-image {
    width: 100%;
  }

  .auth-subscription-side-brand {
    position: static;
    width: min(100%, 260px);
    margin: 0 0 12px;
  }

  .auth-subscription-side-brand-image,
  .auth-brand-lockup-image {
    max-height: none;
  }

  .auth-screen.auth-screen-subscription-debt .auth-copy {
    max-width: none;
  }

  .auth-brand-lockup {
    min-height: 88px;
    margin-bottom: 12px;
  }

  .auth-brand-subtitle {
    margin: 0 0 16px;
    font-size: 0.92rem;
  }

  .auth-brand-lockup-image {
    width: 100%;
    max-width: 240px;
  }

  .auth-title-brand {
    font-size: clamp(1.95rem, 9vw, 2.5rem);
  }

  .auth-brand-tagline {
    font-size: 0.98rem;
    max-width: 22ch;
  }

  .modal-overlay {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    background: rgba(var(--ink-rgb), 0.58);
  }

  .modal-card {
    width: 100%;
    min-height: 100dvh;
    max-height: 100dvh;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    border-radius: 0;
    border: 0;
    box-shadow: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-padding-top: 88px;
    scroll-padding-bottom: 104px;
  }

  .order-modal-card,
  .subscription-offer-modal-card,
  .subscription-checkout-modal-card {
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
  }

  .modal-card > .section-title-row:first-child,
  .modal-card > .subscription-offer-hero:first-child {
    position: sticky;
    top: -16px;
    z-index: 8;
    margin: -16px -16px 16px;
    padding: max(16px, env(safe-area-inset-top)) 16px 14px;
    background: rgba(var(--surface-rgb), 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(var(--line-rgb), 0.85);
  }

  .modal-card > .section-title-row:first-child {
    align-items: flex-start;
  }

  .modal-card > .section-title-row:first-child h3,
  .modal-card > .subscription-offer-hero:first-child h3 {
    font-size: 1.1rem;
  }

  .subscription-modal-brand-row {
    align-items: flex-start;
    gap: 12px;
  }

  .subscription-modal-brand-image-primary,
  .subscription-modal-brand-image-secondary {
    max-width: min(100%, 160px);
    max-height: 56px;
  }

  .auth-subscription-offer-hero p {
    white-space: normal;
  }

  .modal-form {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 112px - env(safe-area-inset-bottom));
  }

  #order-form {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 116px - env(safe-area-inset-bottom));
  }

  .order-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .form-card,
  .fieldset-card,
  .card {
    border-radius: 16px;
  }

  .fieldset-card,
  .card,
  .form-card {
    padding: 16px;
  }

  .section-title-row,
  .fieldset-title-row {
    align-items: flex-start;
    gap: 10px;
  }

  .panel-header {
    gap: 14px;
  }

  .panel-header > button,
  .panel-header .panel-header-nav > button:last-child {
    width: 100%;
    min-height: 48px;
  }

  .panel-header-nav {
    width: 100%;
    align-items: stretch;
  }

  .panel-header-nav > div,
  .panel-header-nav > .panel-header-copy,
  .panel-header-nav > :last-child {
    flex: 1 1 auto;
  }

  .panel-back-button {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
  }

  .section-title-row > button,
  .fieldset-title-row > button {
    width: 100%;
  }

  .order-top-grid,
  .order-meta-row,
  .credit-grid,
  .subscription-offer-plan-grid,
  .subscription-checkout-grid,
  .subscription-checkout-payer-grid,
  .subscription-payment-method-grid {
    grid-template-columns: 1fr;
  }

  .order-meta-row {
    display: grid;
  }

  .order-meta-field,
  .subscription-checkout-payer-document-type-field,
  .subscription-checkout-payer-document-number-field {
    max-width: none;
    width: 100%;
  }

  .subscription-checkout-method-option-list-inline {
    grid-template-columns: 1fr;
  }

  .order-item-row,
  .event-item-row {
    padding: 14px;
    border-radius: 16px;
    background: rgba(var(--surface-rgb), 0.88);
    border: 1px solid rgba(var(--line-rgb), 0.88);
  }

  .order-item-row .remove-item-button,
  .event-item-row .remove-item-button {
    min-height: 48px;
  }

  .mobile-sticky-actions,
  .modal-form > .form-actions:last-child,
  #order-notes-modal .form-actions,
  #order-form .order-items-toolbar,
  .subscription-checkout-footer {
    position: sticky;
    bottom: calc(-16px - env(safe-area-inset-bottom));
    z-index: 9;
    margin: 16px -16px 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(var(--surface-rgb), 0.98);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(var(--line-rgb), 0.88);
    display: grid;
    gap: 10px;
  }

  .subscription-checkout-footer {
    grid-template-columns: 1fr;
  }

  .company-logo-editor .form-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .company-form-section {
    padding: 14px;
    gap: 12px;
    border-radius: 20px;
    background: rgba(var(--surface-rgb), 0.9);
  }

  .company-form-section-heading strong,
  .company-form-section-collapsible summary strong {
    font-size: 1rem;
  }

  .company-form-section-collapsible > summary::after {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .company-logo-preview-shell {
    min-height: 124px;
    padding: 16px;
  }

  .company-logo-preview {
    max-height: 108px;
  }

  .company-logo-editor .file-button,
  .company-logo-editor .secondary-button {
    width: 100%;
    min-height: 48px;
  }

  .table-wrapper {
    overflow: visible;
  }

  .table-wrapper table,
  .table-wrapper thead,
  .table-wrapper tbody,
  .table-wrapper tr,
  .table-wrapper th,
  .table-wrapper td {
    display: block;
    width: 100%;
  }

  .table-wrapper thead {
    display: none;
  }

  .table-wrapper tbody {
    display: grid;
    gap: 12px;
  }

  .table-wrapper .data-row {
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(var(--line-rgb), 0.9);
    background: rgba(var(--surface-rgb), 0.92);
    box-shadow: 0 16px 30px rgba(var(--ink-rgb), 0.06);
  }

  .table-wrapper td {
    border: 0;
    padding: 0;
  }

  .table-wrapper td + td {
    margin-top: 10px;
  }

  .table-wrapper td::before {
    content: attr(data-cell-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .table-wrapper td[data-cell-label="Ações"] {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(var(--line-rgb), 0.72);
  }

  .table-wrapper td[data-cell-label="Ações"]::before {
    margin-bottom: 8px;
  }

  .table-wrapper .data-row .row-actions,
  .table-wrapper .data-row .row-actions.row-actions-visible {
    opacity: 1;
    pointer-events: auto;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .table-wrapper .data-row .icon-action,
  .table-wrapper .data-row .secondary-button,
  .table-wrapper .data-row .primary-inline-button {
    min-height: 44px;
  }

  .modal-form > .form-actions:last-child button,
  #order-notes-modal .form-actions button,
  #order-form .order-items-toolbar button,
  .subscription-checkout-footer button,
  .section-title-row .secondary-button,
  .section-title-row .secondary-inline-button,
  .fieldset-title-row .secondary-inline-button {
    width: 100%;
    min-height: 48px;
  }

  .order-shortcut-hint {
    margin-bottom: 4px;
    padding: 0 4px;
  }

  input,
  select,
  textarea,
  button {
    font-size: 16px;
  }

  body.mobile-tab-screen-active {
    overflow: hidden;
  }

  body.mobile-tab-screen-active .app-shell {
    display: block;
    min-height: 100dvh;
  }

  body.mobile-tab-screen-active .sidebar {
    display: none;
  }

  body.mobile-tab-screen-active .content {
    padding: 0;
    min-height: 100dvh;
    background:
      radial-gradient(circle at top, rgba(var(--accent-rgb), 0.14), transparent 44%),
      linear-gradient(180deg, rgba(var(--surface-rgb), 0.98), rgba(var(--bg-rgb), 0.98));
  }

  body.mobile-tab-screen-active .tab-panel.active {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: max(14px, env(safe-area-inset-top)) 14px calc(20px + env(safe-area-inset-bottom));
    gap: 14px;
  }

  body.mobile-tab-screen-active .tab-panel.active > .card,
  body.mobile-tab-screen-active .tab-panel.active > form,
  body.mobile-tab-screen-active .tab-panel.active > section {
    width: 100%;
  }

  body.mobile-tab-screen-active .tab-panel.active > .panel-header {
    position: sticky;
    top: 0;
    z-index: 7;
    margin: 0 -14px;
    padding: 8px 14px 12px;
    background: rgba(var(--surface-rgb), 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(var(--line-rgb), 0.88);
  }

  body.mobile-tab-screen-active .tab-panel.active > .panel-header h2 {
    font-size: 1.55rem;
    line-height: 1.1;
  }

  body.mobile-tab-screen-active .tab-panel.active > .panel-header > button {
    width: 100%;
  }

  body.mobile-tab-screen-active .tab-panel.active > .panel-header .panel-header-nav {
    width: 100%;
  }

  body.mobile-tab-screen-active .tab-panel.active > .panel-header .panel-back-button.hidden {
    display: none;
  }

  body.mobile-tab-screen-active #tab-company .company-card {
    margin-top: 2px;
  }

  body.mobile-tab-screen-active .company-card-preview {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  body.mobile-tab-screen-active .company-card-logo {
    width: 96px;
    height: 96px;
    border-radius: 20px;
    padding: 10px;
  }

  body.mobile-tab-screen-active .company-card-meta {
    gap: 4px;
    font-size: 13px;
  }
}
/* MOBILE_FORMS_V1_END */
