/* ============================================================================
   7stock — base.css: reset, tipografia e elementos nativos
   ============================================================================ */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html,
body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-relaxed);
  -webkit-font-smoothing: antialiased;
}

body {
  overscroll-behavior-y: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: var(--lh-tight);
}

h1 { font-size: var(--text-3xl); font-weight: 700; }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

a {
  color: var(--status-info);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary);
}

code, pre, .mono {
  font-family: var(--font-mono);
}

code {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: var(--text-sm);
}

button {
  font-family: var(--font-heading);
  color: inherit;
}

input, select, textarea, button {
  font-family: var(--font-body);
  font-size: var(--text-base);
}

/* Evita zoom automático do iOS em campos com fonte menor que 16px */
@media (max-width: 768px) {
  input, select, textarea {
    font-size: 16px;
  }
}

img, svg {
  max-width: 100%;
  display: block;
}

table {
  border-collapse: collapse;
  width: 100%;
}

ul, ol {
  list-style: none;
}

hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: var(--space-4) 0;
}

/* ------------------------------------------------------------- utilitários */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.text-muted { color: var(--text-secondary); }
.text-dim { color: var(--text-tertiary); }
.text-ok { color: var(--status-ok); }
.text-alerta { color: var(--status-alerta); }
.text-critico { color: var(--status-critico); }
.text-primary-accent { color: var(--color-primary); }

/* --------------------------------------------------------------- scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

::selection {
  background-color: var(--color-primary);
  color: #fff;
}

/* -------------------------------------------------------------- foco visível */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ------------------------------------------------------------- impressão */
@media print {
  .no-print,
  .app-header,
  .app-sidebar,
  .mobile-nav {
    display: none !important;
  }

  html, body {
    background: #fff;
    color: #000;
  }

  .card, .modal {
    border: 1px solid #ccc;
    box-shadow: none;
    background: #fff;
    color: #000;
  }

  /* Comprovante de retirada: o modal aberto é impresso na folha inteira */
  .modal-backdrop {
    position: static;
    inset: auto;
    padding: 0;
    background: none;
    backdrop-filter: none;
    display: block;
  }

  .modal {
    max-width: 100%;
    max-height: none;
    animation: none;
    border-radius: 0;
  }

  .modal-body { overflow: visible; }
  .data-table th { position: static; background: #f4f4f4; color: #000; }
  .data-table td, .data-table th { border-color: #ddd; }
  .badge, .tag { border: 1px solid #999; color: #000 !important; background: none !important; }
  .signature-preview { border-color: #999; }
}
