/* ============================================================
   ZAPIMOB — Theme de polimento visual
   Carregado por ÚLTIMO em todas as páginas. Remover este link
   reverte 100% do visual — nenhuma regra aqui é estrutural.
   ============================================================ */

@import url('../vendor/inter/inter.css');

:root {
  --brand-600: #128C4A;
  --brand-500: #16A34A;
  --brand-100: #dcfce7;
  --brand-50: #f0fdf4;
  --surface-border: #e5e7eb;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-card-hover: 0 4px 6px rgba(16, 24, 40, 0.05), 0 10px 15px rgba(16, 24, 40, 0.07);
}

/* ---------- Tipografia ---------- */
body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  letter-spacing: -0.02em;
}

/* ---------- Cards: sombra suave + borda sutil (padrão SaaS) ---------- */
.bg-white.rounded-xl.shadow,
.bg-white.rounded-2xl.shadow,
.bg-white.rounded-lg.shadow {
  box-shadow: var(--shadow-card);
  border: 1px solid var(--surface-border);
  transition: box-shadow 0.15s ease;
}

.bg-white.rounded-xl.shadow:hover,
.bg-white.rounded-2xl.shadow:hover {
  box-shadow: var(--shadow-card-hover);
}

/* ---------- Micro-interações globais ---------- */
button,
a,
input,
select,
textarea {
  transition: background-color 0.15s ease, border-color 0.15s ease,
              color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

button:active:not(:disabled) {
  transform: translateY(0.5px);
}

/* Anel de foco acessível e discreto (teclado) */
:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 1px;
  border-radius: 6px;
}

/* ---------- Botão "Sair": de vermelho chapado para ghost ---------- */
[data-action="logout"] {
  background-color: transparent !important;
  color: #6b7280 !important;
  border: 1px solid var(--surface-border) !important;
}

[data-action="logout"]:hover {
  background-color: #fef2f2 !important;
  color: #dc2626 !important;
  border-color: #fecaca !important;
}

/* ---------- Scrollbar discreta (desktop) ---------- */
@media (min-width: 768px) {
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
  }
}

/* ---------- Inputs mais refinados ---------- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
select,
textarea {
  border-color: #d1d5db;
}

input:hover:not(:focus),
select:hover:not(:focus),
textarea:hover:not(:focus) {
  border-color: #9ca3af;
}

/* ---------- Tabelas: linhas com hover suave ---------- */
tbody tr {
  transition: background-color 0.1s ease;
}

tbody tr:hover {
  background-color: #f9fafb;
}

/* ---------- Movimento reduzido: respeita preferência do usuário ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Markinho Auto: tema de trabalho claro, sem efeitos da identidade antiga. */
:root {
  --brand-600: #2563a8;
  --brand-500: #3277bc;
  --brand-100: #e5effa;
  --brand-50: #f2f7fc;
  --surface-border: #e2e8f0;
  --nav-active-color: #2563a8;
  --nav-active-bg: #e5effa;
  --nav-hover-bg: #f2f7fc;
  --nav-bg-color: #fff;
  --nav-text-color: #243247;
  --nav-text-muted: #59677a;
  --status-connected: #15803d;
  --status-ai: #7c3aed;
}
body { background-color: #f5f7fa; color: #243247; }
.navbar-dark { background: #fff !important; border-bottom: 1px solid var(--surface-border); box-shadow: none !important; }
.navbar-dark .nav-link, .nav-links .nav-link { display: inline-flex; align-items: center; gap: 7px; padding: 9px 10px; border-radius: 8px; color: var(--nav-text-muted); font-size: 13px; font-weight: 500; white-space: nowrap; text-decoration: none; }
.navbar-dark .nav-link:hover { background: var(--brand-50) !important; color: var(--brand-600) !important; }
.navbar-dark .nav-link.active, .nav-links .nav-link.active { color: var(--brand-600) !important; background: var(--brand-100) !important; box-shadow: none !important; }
.nav-logo { width: 176px; height: 44px !important; max-width: 100%; object-fit: contain; }
.nav-links { align-items: center; gap: 2px; }
.nav-links > :not([hidden]) ~ :not([hidden]) { margin-left: 0 !important; }
.markinho-more { position: relative; }
.markinho-more summary { cursor: pointer; list-style: none; }
.markinho-more summary::-webkit-details-marker { display: none; }
.markinho-more-links { position: absolute; right: 0; top: calc(100% + 8px); z-index: 90; min-width: 205px; padding: 6px; border: 1px solid var(--surface-border); border-radius: 12px; background: #fff; box-shadow: var(--shadow-card-hover); }
.markinho-more-links .nav-link { display: flex; }
.mobile-bottom-nav { background: #fff !important; border-top: 1px solid var(--surface-border); box-shadow: none !important; }
.mobile-nav-item { color: var(--nav-text-muted) !important; }
.mobile-nav-item.is-active, .mobile-admin-link.is-active { color: var(--brand-600) !important; background: var(--brand-100) !important; }
.mobile-admin-sheet { background: #fff !important; max-height: 85dvh; overflow-y: auto; }
.mobile-admin-link { color: var(--nav-text-color); }
.mobile-admin-link i { color: var(--brand-600); }
.animate-pulse-slow, .animate-glow-pulse, .animate-logo-float { animation: none !important; }
.status-connected { color: var(--status-connected); background: #f0fdf4; }
.status-ai { color: var(--status-ai); background: #f5f3ff; }
@media (min-width: 768px) and (max-width: 1199px) {
  .nav-links .nav-link { padding: 8px 6px; font-size: 12px; gap: 4px; }
  .nav-links > .nav-link i { display: none; }
  .nav-logo { width: 142px; }
}
@media (max-width: 767px) {
  .mobile-bottom-nav { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
  .mobile-nav-item { min-width: 0; font-size: 10px; }
  .mobile-nav-item > i { font-size: 19px; }
  .nav-logo { width: 160px; }
}
@media (max-width: 767px) {
  .mobile-bottom-nav { display: grid !important; gap: 4px; overflow-x: hidden; }
  .mobile-bottom-nav .mobile-nav-item { min-width: 0; font-size: 10px; }
}

/* Keep the scope filter and account actions inside the viewport, including
   long administrator names and instance labels. */
.navbar-dark .mobile-nav-bar { flex-wrap: wrap; gap: 8px 12px; height: auto; padding-block: 8px; }
.navbar-dark .mobile-nav-bar > div:first-child { min-width: 0; max-width: 100%; flex-wrap: wrap; }
.navbar-dark .nav-links { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.navbar-dark .mobile-top-actions { min-width: 0; max-width: 100%; flex-wrap: wrap; }
#globalUserFilterWrapper { min-width: 0; max-width: 100%; flex-wrap: wrap; }
#globalUserFilter { min-width: 0; max-width: min(180px, 100%); }
#globalInstanceFilterBadge { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.navbar-dark .nav-user { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-admin-sheet { box-sizing: border-box; max-width: 100%; }
@media (max-width: 767px) {
  .navbar-dark .mobile-nav-bar > div:first-child { flex: 1 1 100%; }
  .navbar-dark .mobile-top-actions { width: 100%; justify-content: flex-start; flex-shrink: 1; }
  .navbar-dark #globalUserFilterWrapper { flex: 1 1 100%; }
  .navbar-dark #globalUserFilter { max-width: 150px; }
  .navbar-dark #globalInstanceFilterBadge { max-width: 110px; }
  .mobile-admin-backdrop { background: rgba(36, 50, 71, .24); }
}
@media (max-width: 767px) {
  body.mobile-nav-enabled #gerente-fab { bottom: calc(var(--mobile-nav-height) + 12px) !important; right: 12px; }
  body.mobile-nav-enabled #gerente-panel { bottom: calc(var(--mobile-nav-height) + 80px) !important; max-height: calc(100dvh - var(--mobile-nav-height) - 96px); }
}

/* Acabamento comum: superfícies leves e ações com a cor da loja. */
:root { --shadow-card: 0 2px 6px rgba(36, 50, 71, .035); --shadow-card-hover: 0 5px 16px rgba(36, 50, 71, .065); }
body { line-height: 1.5; }
.bg-white.rounded-xl.shadow-lg, .bg-white.rounded-2xl.shadow-lg { border: 1px solid var(--surface-border); box-shadow: var(--shadow-card); }
.bg-white.rounded-xl.shadow, .bg-white.rounded-xl.shadow-lg { border-radius: 14px; }
button.bg-green-600, button.bg-gradient-to-r.from-green-600 { background: var(--brand-600); background-image: none; }
button.bg-green-600:hover, button.bg-gradient-to-r.from-green-600:hover { background: #1f568f; }
button:disabled { cursor: not-allowed; }
input, select, textarea { --tw-ring-color: var(--brand-500); }
input:focus, select:focus, textarea:focus { --tw-ring-color: var(--brand-500); }
input::placeholder, textarea::placeholder { color: #94a3b8; }
.navbar-dark .nav-link { transition: background-color .15s ease, color .15s ease; }
#stockFilters, #filters { border-color: var(--surface-border); }
/* Closed mobile navigation must not extend the page below the viewport. */
@media (max-width: 767px) {
  .mobile-admin-menu { visibility: hidden; overflow: hidden; }
  .mobile-admin-menu.is-open { visibility: visible; }
}

/* CHAVE IA Auto: same shell and controls, pearl surfaces and deep blue identity. */
:root { --brand-600:#07558e; --brand-500:#087ac1; --brand-100:#dcecf9; --brand-50:#edf5fb; --surface-border:#d5dde5; }
body.bg-gray-50, body.bg-gray-100, body.app-shell { background-color:#f6f4ef; color:#19344e; }
.app-shell main > h1, .app-shell main > div > h1 { color:#073968; }
input:not([type=checkbox]):not([type=radio]), select, textarea { border-color:#cbd6e0; }
/* Login remains recognizable and usable on small screens. */
body:not(.app-shell) .max-w-md { border:1px solid #d5dde5; box-shadow:0 16px 50px #07396812; }
body:not(.app-shell) img[src*="logo.png"] { height:128px; max-width:100%; object-fit:contain; }
