/* ═══════════════════════════════════════════
   QUISOQUE GER — Design System
   Mobile-first | Flexbox | Vanilla CSS
   ═══════════════════════════════════════════ */

/* ─── Variables — Paleta PMMG (Dourado / Preto / Vermelho) ─── */
:root {
  /* Primária — dourado militar */
  --primary-900: #3d2e0a;
  --primary-700: #7a5c14;
  --primary-500: #b8943d;
  --primary-300: #d4b96a;
  --primary-100: #f5edd4;

  /* Neutros */
  --gray-950: #0a0a0a;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-400: #9ca3af;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --white: #ffffff;

  --bg-app: #f3f4f6;
  --bg-card: #ffffff;
  --bg-glass: rgba(255,255,255,0.10);
  --text-main: #111827;
  --text-muted: #6b7280;
  --text-inverse: #ffffff;
  --border: #e5e7eb;
  --border-focus: #b8943d;

  /* Semânticas */
  --success: #16a34a;
  --error: #c41a1a;
  --warning: #d97706;
  --info: #2563eb;

  /* Gradientes — PMMG */
  --grad-hero: linear-gradient(135deg, #1a1a1a 0%, #3d2e0a 50%, #1a1a1a 100%);
  --grad-card: linear-gradient(180deg, rgba(184,148,61,0.06) 0%, transparent 100%);

  /* Accent — vermelho PMMG (faixa) */
  --accent-red: #c41a1a;
  --accent-red-dark: #8b1111;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.10);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
}

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

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-main);
  background: var(--bg-app);
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a { color: var(--primary-500); text-decoration: none; }

/* ─── Typography ─── */
h1 { font-weight: 700; font-size: 1.867rem; line-height: 1.2; letter-spacing: -0.5px; }
h2 { font-weight: 600; font-size: 1.467rem; line-height: 1.3; }
h3 { font-weight: 600; font-size: 1.2rem; line-height: 1.4; }
.mono { font-family: 'Roboto Mono', monospace; font-weight: 600; }

/* ─── Animations ─── */
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes slideUp { from{transform:translateY(20px);opacity:0} to{transform:translateY(0);opacity:1} }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)} }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
@keyframes scaleIn { from{transform:scale(0.95);opacity:0} to{transform:scale(1);opacity:1} }
@keyframes spin { to{transform:rotate(360deg)} }
@keyframes pop { 0%{transform:scale(1)} 50%{transform:scale(1.3)} 100%{transform:scale(1)} }

.anim-fadein   { animation: fadeIn 0.3s ease forwards; }
.anim-slideup  { animation: slideUp 0.35s ease both; }
.anim-shake    { animation: shake 0.4s ease; }
.anim-scalein  { animation: scaleIn 0.25s ease forwards; }
.loading-spin  { animation: spin 0.8s linear infinite; }
.anim-pop      { animation: pop 0.25s ease; }

/* ═══════════════════════════════════════════
   COMPONENTS
   ═══════════════════════════════════════════ */

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 24px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.933rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--primary-500);
  color: var(--text-inverse);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(184,148,61,0.35);
}

.btn-outline {
  border: 2px solid var(--primary-500);
  color: var(--primary-500);
  background: transparent;
}
.btn-outline:hover:not(:disabled) {
  background: var(--primary-100);
}

.btn-danger {
  background: var(--error);
  color: var(--text-inverse);
}
.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  transform: translateY(-1px);
}

.btn-sm { padding: 8px 16px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.btn-icon:hover { color: var(--error); }

.btn-loading { display: none; }
.btn.is-loading .btn-text { display: none; }
.btn.is-loading .btn-loading { display: inline-flex; }

/* ─── Inputs ─── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: var(--text-main);
  background: var(--white);
  transition: all 0.2s;
  outline: none;
}

.form-input::placeholder { color: var(--gray-400); }

.form-input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(184,148,61,0.2);
}

.form-input.has-icon { padding-left: 44px; }

.input-icon-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 4px;
  transition: color 0.2s;
}
.toggle-password:hover { color: var(--text-main); }

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.flex-1 { flex: 1; min-width: 0; }
.flex-2 { flex: 2; min-width: 0; }

/* ─── File Upload ─── */
.file-upload-area {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}

.file-upload-area:hover,
.file-upload-area.dragover {
  border-color: var(--primary-500);
  background: rgba(184,148,61,0.06);
}

.file-upload-area.compact { padding: 16px; }

.file-input-hidden {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.867rem;
}

.file-upload-hint {
  font-size: 0.733rem;
  color: var(--gray-400);
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-preview img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

/* ─── Cards ─── */
.section-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 20px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--gray-900);
  font-size: 1.2rem;
}

.section-title svg { color: var(--primary-500); flex-shrink: 0; }

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.section-title-sm {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--gray-800);
}

/* ─── Badge ─── */
.badge {
  display: inline-flex;
  align-items: center;
  background: var(--primary-100);
  color: var(--primary-700);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-weight: 600;
  font-size: 0.8rem;
}

/* ─── Alert ─── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.867rem;
  font-weight: 500;
  margin-bottom: 20px;
}

.alert-error {
  background: #fef2f2;
  color: var(--error);
  border: 1px solid #fecaca;
}

/* ─── Toast ─── */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.867rem;
  font-weight: 500;
  color: var(--white);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease forwards;
  pointer-events: auto;
  max-width: 90vw;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--error); }
.toast-warning { background: var(--warning); }
.toast-info { background: var(--info); }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--white);
  border-radius: 20px;
  padding: 32px;
  max-width: 90vw;
  width: 400px;
  text-align: center;
}

.modal-title {
  margin-bottom: 12px;
  color: var(--gray-900);
}

.modal-text {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 0.933rem;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ─── Table ─── */
.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.867rem;
}

.table th {
  background: var(--gray-100);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.733rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table tbody tr:hover { background: rgba(184,148,61,0.05); }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.733rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-pendente { background: #fef3c7; color: #92400e; }
.status-pago { background: #d1fae5; color: #065f46; }
.status-feito { background: #d1fae5; color: #065f46; }

/* ─── Relatorio Totais ─── */
.relatorio-totais {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.relatorio-total-card {
  flex: 1;
  min-width: 160px;
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.relatorio-total-label {
  font-size: 0.733rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.relatorio-total-value {
  font-size: 1.333rem;
  font-weight: 700;
  color: var(--primary-700);
}

.relatorio-filtros {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 16px;
}

.relatorio-filtros .form-group { margin-bottom: 0; }

/* ─── Edit Modal ─── */
.modal-edit {
  width: 480px;
  text-align: left;
}

.edit-img-preview {
  padding: 8px 0;
}

/* ─── Relatório Estilo Militar ─── */
.relatorio-militar {
  background: var(--white);
  border: 2px solid var(--gray-800);
  border-radius: var(--radius-sm);
  padding: 24px;
  margin-top: 16px;
}

.rel-mil-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
  text-align: center;
}

.rel-mil-title-wrap { flex: 1; }

.rel-mil-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--gray-900);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.rel-mil-periodo {
  font-size: 0.867rem;
  font-weight: 600;
  color: var(--primary-700);
  font-style: italic;
}

.rel-mil-totais {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 24px;
}

.rel-mil-total-box {
  border: 2px solid var(--gray-800);
  padding: 12px 32px;
  text-align: center;
}

.rel-mil-total-label {
  font-size: 0.733rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--gray-700);
  margin-bottom: 4px;
}

.rel-mil-total-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gray-900);
}

.rel-mil-section-header {
  background: var(--gray-900);
  color: var(--primary-300);
  font-weight: 700;
  font-size: 0.867rem;
  padding: 8px 14px;
  border-left: 4px solid var(--accent-red);
  margin-bottom: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table-militar {
  border: 1px solid var(--gray-700);
}

.table-militar th {
  background: var(--gray-800) !important;
  color: var(--white) !important;
  font-size: 0.7rem;
  padding: 8px 10px;
  border: 1px solid var(--gray-700);
}

.table-militar td {
  border: 1px solid var(--gray-200);
  padding: 8px 10px;
  font-size: 0.8rem;
}

.table-militar tbody tr:nth-child(even) {
  background: var(--gray-100);
}

.table-militar tbody tr:hover {
  background: var(--primary-100);
}

.btn-download-comp {
  padding: 4px 8px !important;
  gap: 4px !important;
  font-size: 0.7rem !important;
}

/* ─── Divider ─── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
  font-size: 0.933rem;
}

/* ═══════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════ */

.login-body {
  background: var(--gray-900);
  background-image: radial-gradient(ellipse at 50% 0%, rgba(184,148,61,0.12) 0%, transparent 60%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-wrapper {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(184,148,61,0.25);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo img {
  width: 120px;
  height: auto;
  margin: 0 auto 20px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.login-logo h1 {
  color: var(--primary-300);
  font-size: 1.867rem;
  letter-spacing: 2px;
}

.login-subtitle {
  color: rgba(255,255,255,0.5);
  font-size: 0.867rem;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.login-card .form-label { color: rgba(255,255,255,0.7); }

.login-card .form-input {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: var(--white);
}

.login-card .form-input::placeholder { color: rgba(255,255,255,0.35); }

.login-card .form-input:focus {
  border-color: var(--primary-300);
  box-shadow: 0 0 0 3px rgba(184,148,61,0.25);
  background: rgba(255,255,255,0.12);
}

.login-card .input-icon { color: rgba(255,255,255,0.4); }
.login-card .toggle-password { color: rgba(255,255,255,0.4); }
.login-card .toggle-password:hover { color: rgba(255,255,255,0.8); }

.login-card .btn-primary {
  margin-top: 8px;
  padding: 16px;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.login-card .alert-error {
  background: rgba(220,38,38,0.15);
  border-color: rgba(220,38,38,0.3);
  color: #fca5a5;
}

/* ═══════════════════════════════════════════
   ADMIN PAGE
   ═══════════════════════════════════════════ */

.admin-body { background: var(--bg-app); }

.admin-header {
  background: var(--gray-900);
  border-bottom: 3px solid var(--accent-red);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.header-title {
  font-size: 1.2rem;
  letter-spacing: 0.5px;
  color: var(--primary-300);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user {
  font-size: 0.867rem;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}

.admin-header .btn-outline {
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.8);
}
.admin-header .btn-outline:hover:not(:disabled) {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.5);
}

.admin-header .badge {
  background: rgba(184,148,61,0.2);
  color: var(--primary-300);
}

.admin-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
}

/* ─── Produtos Grid (Admin) ─── */
.produtos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.produto-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.25s ease;
  animation: slideUp 0.35s ease both;
}

.produto-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.produto-card.inativo { opacity: 0.55; }

.produto-img-wrap {
  position: relative;
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: var(--gray-100);
}

.produto-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.produto-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  background: var(--gray-100);
}

.produto-badge-inativo {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: var(--white);
  font-size: 0.667rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.produto-info {
  padding: 12px 14px 8px;
}

.produto-cat-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 4px;
}

.cat-comida {
  background: #fef3c7;
  color: #92400e;
}

.cat-bebida {
  background: #dbeafe;
  color: #1e40af;
}

.cat-bebida-quente {
  background: #ffe4d6;
  color: #9a3412;
}

.produto-nome {
  font-size: 0.933rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--gray-900);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.produto-valor {
  color: var(--primary-700);
  font-size: 1.067rem;
}

.produto-actions {
  padding: 8px 14px 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.produto-actions .btn-toggle { flex: 1; }

/* ═══════════════════════════════════════════
   COMPRAS PAGE (registrecompras)
   ═══════════════════════════════════════════ */

.compras-body { background: var(--bg-app); }

.compras-header {
  background: var(--gray-900);
  border-bottom: 3px solid var(--accent-red);
  padding: 20px;
}

.compras-header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.compras-header-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.3));
}

.compras-title {
  color: var(--primary-300);
  font-size: 1.467rem;
  letter-spacing: 0.5px;
}

.compras-subtitle {
  color: rgba(255,255,255,0.7);
  font-size: 0.867rem;
}

.compras-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}

/* ─── Compras Grid ─── */
.compras-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.compra-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.compra-card.has-items {
  box-shadow: 0 0 0 2px var(--primary-500), var(--shadow-sm);
}

.compra-card.no-items { opacity: 0.6; }

.compra-card-img {
  width: 100%;
  height: 100px;
  overflow: hidden;
  background: var(--gray-100);
}

.compra-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compra-card-info {
  padding: 10px 12px 6px;
  flex: 1;
}

.compra-card-nome {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.3;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compra-card-valor {
  color: var(--primary-700);
  font-size: 0.933rem;
}

.compra-card-qty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px 12px;
}

.qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.2s;
}

.qty-btn:hover {
  border-color: var(--primary-500);
  background: var(--primary-100);
  color: var(--primary-700);
}

.qty-btn:active { transform: scale(0.92); }

.qty-value {
  font-size: 1.067rem;
  min-width: 28px;
  text-align: center;
  color: var(--gray-900);
  transition: transform 0.15s;
}

/* ─── Resumo ─── */
.resumo-section {
  position: sticky;
  bottom: 0;
  z-index: 50;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  padding: 16px 18px;
}

.resumo-section .section-title {
  font-size: 1rem;
  margin-bottom: 10px;
}

.resumo-lista {
  margin-bottom: 8px;
  max-height: 130px;
  overflow-y: auto;
}

.resumo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.8rem;
}

.resumo-item-left {
  display: flex;
  gap: 8px;
  align-items: center;
}

.resumo-item-qty {
  background: var(--primary-100);
  color: var(--primary-700);
  font-weight: 600;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.resumo-item-subtotal {
  font-weight: 600;
  color: var(--gray-800);
}

.resumo-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 6px;
  font-weight: 700;
  font-size: 1rem;
  border-top: 2px solid var(--gray-900);
}

.resumo-total-valor {
  color: var(--primary-700);
  font-size: 1.15rem;
  transition: all 0.2s;
}

.resumo-section .btn-block { padding: 10px 14px; font-size: 0.9rem; }

/* ─── PIX Section ─── */
.pix-section { text-align: center; }

.pix-icon { margin-bottom: 12px; }

.pix-title {
  color: var(--primary-700);
  font-size: 1.467rem;
  margin-bottom: 8px;
}

.pix-desc {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 0.933rem;
}

.pix-box {
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 8px;
}

.pix-label {
  display: block;
  font-size: 0.667rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.pix-key-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pix-key {
  font-size: 1rem;
  color: var(--gray-900);
  word-break: break-all;
}

.pix-key-row .btn .icon-check { color: var(--success); }

/* ─── PIX Valor Destaque ─── */
.pix-valor-destaque {
  background: var(--gray-900);
  border: 2px solid var(--primary-500);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  margin-bottom: 24px;
  text-align: center;
}

.pix-valor-label {
  display: block;
  font-size: 0.667rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 4px;
}

.pix-valor-numero {
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.5px;
}

/* ─── QR Code ─── */
.pix-qr-wrap {
  margin-bottom: 24px;
}

.pix-qr-container {
  display: flex;
  justify-content: center;
  padding: 16px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.pix-qr-container svg {
  max-width: 240px;
  max-height: 240px;
  width: 100%;
  height: auto;
}

.pix-qr-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* ─── PIX Copia e Cola ─── */
.pix-copiacola-wrap {
  margin-top: 8px;
}

.pix-copiacola {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.733rem;
  color: var(--gray-700);
  background: var(--white);
  resize: none;
  word-break: break-all;
  line-height: 1.4;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

.pix-copiacola:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(184,148,61,0.2);
}

.cancelar-compra-wrap {
  text-align: center;
}

.cancelar-hint {
  font-size: 0.733rem;
  color: var(--gray-400);
  margin-top: 8px;
}

.upload-comprovante { text-align: left; }

.comprovante-ok {
  text-align: center;
  margin-top: 16px;
  color: var(--success);
  font-weight: 600;
}

.comprovante-ok p { margin-top: 8px; }

.agradecimento {
  text-align: center;
}

.agradecimento p {
  font-size: 1.133rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 16px;
}

/* ═══════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════ */

@media print {
  body { background: white !important; }
  .admin-header, .relatorio-filtros, .modal-overlay, .modal-edit,
  #formProduto, #produtosGrid, .section-title-row .btn,
  .btn-download-comp { display: none !important; }
  .section-card { box-shadow: none; break-inside: avoid; border: none; }
  .relatorio-militar { border: 2px solid #000; page-break-inside: avoid; }
  .table-militar th { background: #333 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table-militar tbody tr:nth-child(even) { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .status-feito { background: #d1fae5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rel-mil-section-header { background: #1a1a1a !important; color: #d4b96a !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rel-mil-totais { margin-bottom: 16px; }
  .btn-imprimir-hide { display: none !important; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 600px) {
  .form-row { flex-direction: column; }
  .form-row .flex-1,
  .form-row .flex-2 { width: 100%; }
  .form-row > div[style*="width"] { width: 100% !important; }

  .produtos-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .compras-grid { grid-template-columns: repeat(2, 1fr); }

  .admin-header { padding: 10px 14px; }
  .header-title { font-size: 1rem; }

  .section-card { padding: 16px; }
  .resumo-section { padding: 12px 14px; }

  .login-card { padding: 28px 20px; }

  .relatorio-filtros { flex-direction: column; }
  .relatorio-filtros .form-group { width: 100%; }

  .pix-key-row { flex-direction: column; }

  .section-title-row { flex-direction: column; align-items: flex-start; }

  /* Resumo fixo no mobile para não sobrepor produtos */
  #etapa1 .resumo-section {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -6px 18px rgba(0,0,0,0.18);
    max-height: 55vh;
    overflow-y: auto;
  }
  #etapa1 .resumo-section .resumo-lista { max-height: 90px; }
  #etapa1 .resumo-section .section-title { margin-bottom: 6px; font-size: 0.95rem; }

  /* Garante que o conteúdo role acima do resumo fixo */
  body.compras-body .compras-main { padding-bottom: 240px; }
}

@media (max-width: 380px) {
  .compras-grid { grid-template-columns: 1fr; }
  #etapa1 .resumo-section .resumo-lista { max-height: 70px; }
  body.compras-body .compras-main { padding-bottom: 220px; }
}
