/* ═══════════════════════════════════════════════════════════════
   OrbePay UI App — mobile-first, zero-delay, GPU transitions
   ═══════════════════════════════════════════════════════════════ */

:root {
  --app-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --app-fast: 0.1s;
  --app-med: 0.22s;
  --app-nav-ind: 3px;
}

/* ── Zero delay touch (global) ── */
a,
button,
[role="button"],
.ui-dropdown__trigger,
.ui-dropdown__opt,
input,
select,
textarea {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ── App shell extras ── */
html.app-shell .admin-nav a,
html.app-shell .side-nav a,
html.app-shell .nav-group-btn,
html.app-shell .mobile-tabbar .tab,
html.app-shell .admin-tabbar .tab,
html.app-shell .btn,
html.app-shell .chip,
html.app-shell label[for] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ── Scrollbars ocultas (visual app) ── */
html.app-shell,
html.app-shell body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html.app-shell ::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

html.app-shell .admin-sidebar,
html.app-shell .admin-main,
html.app-shell .sidebar,
html.app-shell .content,
html.app-shell .section-view,
html.app-shell .table-wrap,
html.app-shell .modal {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* ── Tap feedback nativo (100ms) ── */
@media (prefers-reduced-motion: no-preference) {
  html.app-shell .admin-nav a,
  html.app-shell .side-nav a,
  html.app-shell .nav-group-btn,
  html.app-shell .mobile-tabbar .tab,
  html.app-shell .admin-tabbar .tab,
  html.app-shell .btn,
  html.app-shell .ui-dropdown__trigger,
  html.app-shell .ui-dropdown__opt,
  html.app-shell .chip,
  html.app-shell .chip-icon,
  html.app-shell .tx-view-btn,
  html.app-shell .admin-menu-btn,
  html.app-shell .mobile-menu-btn {
    transition: transform var(--app-fast) var(--app-ease),
      background var(--app-med) var(--app-ease),
      color var(--app-med) var(--app-ease),
      box-shadow var(--app-med) var(--app-ease) !important;
  }

  html.app-shell .admin-nav a:active,
  html.app-shell .side-nav a:active,
  html.app-shell .nav-group-btn:active,
  html.app-shell .mobile-tabbar .tab:active,
  html.app-shell .admin-tabbar .tab:active,
  html.app-shell .btn:active,
  html.app-shell .ui-dropdown__trigger:active,
  html.app-shell .ui-dropdown__opt:active,
  html.app-shell .chip:active,
  html.app-shell .chip-icon:active,
  html.app-shell .tx-view-btn:active,
  html.app-shell .admin-menu-btn:active,
  html.app-shell .mobile-menu-btn:active {
    transform: scale(0.98) !important;
    transition-duration: var(--app-fast) !important;
  }

  html.app-shell table tbody tr.app-row-tap {
    transition: transform var(--app-fast) var(--app-ease),
      background var(--app-med) var(--app-ease);
  }

  html.app-shell table tbody tr.app-row-tap:active {
    transform: scale(0.995);
  }
}

/* ── Blocos estruturais estáticos (sem hover lift) ── */
html.app-shell .card:hover,
html.app-shell .kpi-card:hover,
html.app-shell .kpi:hover,
html.app-shell .tx-stat:hover,
html.app-shell .saldo-card:hover,
html.app-shell .status-card:hover,
html.app-shell .perf-card:hover,
html.app-shell .admin-kpi-grid .kpi:hover {
  transform: none !important;
}

html.app-shell .card:hover,
html.app-shell .admin-kpi-grid .kpi:hover {
  border-color: rgba(0, 184, 255, 0.22);
  box-shadow: 0 4px 16px rgba(0, 80, 160, 0.08);
}

/* ── Indicador lateral deslizante ── */
.admin-nav.has-nav-indicator,
.side-nav.has-nav-indicator {
  position: relative;
}

.nav-slide-indicator {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--app-nav-ind);
  height: 40px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #33d6ff, #0099ff);
  box-shadow: 0 0 14px rgba(51, 214, 255, 0.55);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transform: translate3d(0, 0, 0);
  transition:
    transform var(--app-med) var(--app-ease),
    height var(--app-med) var(--app-ease),
    opacity 0.15s var(--app-ease);
  will-change: transform, height;
}

.has-nav-indicator a.active::before,
.has-nav-indicator button.active::before {
  opacity: 0 !important;
}

/* ── Transição de conteúdo (shell fixo) ── */
#viewContent,
.app-view-host {
  min-height: min(52vh, 480px);
  contain: layout style;
}

.view-content-in {
  animation: appContentIn 0.16s var(--app-ease) both;
}

@keyframes appContentIn {
  from {
    opacity: 0.72;
    transform: translate3d(0, 4px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

html.app-shell .view-enter {
  animation: appContentIn 0.16s var(--app-ease) both !important;
}

/* ── Skeleton estático + pulse (sem shimmer) ── */
html.app-shell .sk-block::after {
  display: none !important;
}

html.app-shell .sk-block {
  animation: skPulse 1.35s ease-in-out infinite;
  background: rgba(255, 255, 255, 0.07);
}

@keyframes skPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.app-skeleton-shell {
  --sk-row-h: 48px;
  min-height: calc(var(--sk-rows, 7) * var(--sk-row-h) + 72px);
}

.app-skeleton-shell .table-wrap {
  min-height: calc(var(--sk-rows, 7) * var(--sk-row-h) + 40px);
}

.admin-kpi-grid.app-kpi-skeleton {
  min-height: 88px;
}

/* ── Empty state: ícone estático ── */
html.app-shell .empty-state__icon {
  animation: none !important;
}

/* ── Drawer mobile (GPU) ── */
html.app-shell .admin-sidebar,
html.app-shell .sidebar {
  transition: transform 0.28s var(--app-ease);
  will-change: transform;
}

.admin-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.52);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--app-ease);
}

.admin-drawer-backdrop[hidden] {
  display: none !important;
}

body.drawer-open .admin-drawer-backdrop:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

/* ── Bottom nav admin (mobile) ── */
.admin-tabbar {
  display: none;
}

@media (max-width: 900px) {
  html.app-shell .admin-main {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .admin-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 85;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(6, 16, 29, 0.96);
    border-top: 1px solid rgba(0, 184, 255, 0.14);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    gap: 4px;
    justify-content: space-around;
  }

  .admin-tabbar .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 4px;
    border-radius: 12px;
    color: var(--muted, #7d93ad);
    font-size: 0.62rem;
    font-weight: 700;
    max-width: 72px;
    touch-action: manipulation;
  }

  .admin-tabbar .tab svg {
    width: 20px;
    height: 20px;
    opacity: 0.85;
  }

  .admin-tabbar .tab.is-active {
    color: #7dd3fc;
    background: rgba(0, 153, 255, 0.12);
  }

  .admin-tabbar .tab.is-active svg {
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(51, 214, 255, 0.45));
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-slide-indicator,
  .view-content-in,
  html.app-shell .view-enter,
  html.app-shell .sk-block {
    animation: none !important;
    transition: none !important;
  }
}
