@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy: #0d1b3e;
  --navy-light: #142350;
  --teal: #19b7a0;
  --teal-dark: #0e8f7c;
  --bg: #f3f5f9;
  --border: #e2e6ee;
  --text: #15192b;
  --muted: #6b7280;
}

* { box-sizing: border-box; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
header {
  background: var(--navy);
  color: #fff;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}
header h1 { margin: 0; font-size: 16px; font-weight: 600; }
header .sub { font-size: 12px; color: #9aa4c2; margin-top: 1px; }
.login-card .sub { color: var(--muted); }
.header-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.header-user #header-user-nome { font-weight: 500; }
.header-user .badge { background: rgba(25, 183, 160, 0.2); color: #6ee7d5; }
.header-user button.secondary {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  margin-bottom: 0;
}
.header-user button.secondary:hover { background: rgba(255, 255, 255, 0.18); }

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
}
.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 32px 28px;
  width: 320px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.login-card h1 { font-size: 16px; margin: 0; color: var(--navy); }
.login-card label { display: block; font-size: 12px; color: var(--muted); margin: 14px 0 4px; font-weight: 500; }
.login-card input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #d4d8e2;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.login-card input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(25, 183, 160, 0.15);
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  font-size: 13.5px;
}
.breadcrumb .crumb-home {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
  font-family: inherit;
  padding: 0;
}
.breadcrumb .crumb-home:hover { color: var(--teal-dark); }
.breadcrumb .crumb-sep { color: var(--muted); display: none; }
.breadcrumb .crumb-current { color: var(--muted); font-weight: 500; display: none; }

main { padding: 32px 24px 60px; max-width: 980px; margin: 0 auto; }
.view { display: none; }

/* ---------- Menu Principal ---------- */
#view-menu.active {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 170px);
}
.menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 176px);
  gap: 16px;
}
.menu-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 176px;
  height: 164px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(13, 27, 62, 0.03);
}
.menu-card:hover {
  border-color: var(--teal);
  box-shadow: 0 4px 10px rgba(13, 27, 62, 0.08);
}
.menu-card h3 { margin: 0 0 4px; font-size: 14.5px; font-weight: 600; color: var(--navy); }
.menu-card p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.menu-card-icon { width: 30px; height: 30px; color: var(--teal-dark); margin-top: 16px; }

@media (max-width: 800px) {
  .menu-grid { grid-template-columns: repeat(2, 176px); }
}
@media (max-width: 420px) {
  .menu-grid { grid-template-columns: 176px; }
}
.view.active { display: block; }
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(13, 27, 62, 0.03);
}
.card h2 { margin-top: 0; font-size: 15px; font-weight: 600; color: var(--navy); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
input, select, textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #d4d8e2;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(25, 183, 160, 0.15);
}
button.primary {
  background: var(--teal);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  margin-top: 14px;
  font-family: inherit;
}
button.primary:hover { background: var(--teal-dark); }
button.secondary {
  background: #eef1f6;
  color: var(--navy);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  margin-bottom: 10px;
}
button.secondary:hover { background: #e3e7ef; }
table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eef0f4; }
th { background: #f7f8fb; color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.02em; }
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.badge.ativo, .badge.disponivel { background: #e0f7f2; color: var(--teal-dark); }
.badge.encerrado, .badge.consumido { background: #eceff2; color: #555; }
.msg { margin-top: 12px; font-size: 13px; padding: 10px 12px; border-radius: 6px; }
.msg.ok { background: #e0f7f2; color: var(--teal-dark); }
.msg.erro { background: #fde8e8; color: #c0392b; }
.muted { color: var(--muted); font-size: 12px; }

/* ---------- Relatório de LPEs ---------- */
#tabela-relatorio { width: max-content; min-width: 100%; }
#tabela-relatorio th, #tabela-relatorio td { white-space: nowrap; }

/* ---------- Etiquetas (LPE) ---------- */
#tabela-etiquetas input[type="checkbox"] {
  width: auto;
}
#area-impressao { display: none; }

.etiquetas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3mm;
  padding: 5mm;
}
.etiqueta {
  border: 1px dashed #999;
  border-radius: 2px;
  padding: 2.5mm 3mm;
  font-size: 9px;
  line-height: 1.35;
  page-break-inside: avoid;
  break-inside: avoid;
}
.etiqueta .et-tipo {
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.03em;
  color: var(--teal-dark);
}
.etiqueta .et-lpe {
  float: right;
  font-weight: 700;
  font-size: 10px;
}
.etiqueta .et-produto { font-weight: 600; font-size: 10px; margin-top: 2px; }
.etiqueta .et-linha { margin-top: 1px; }
.etiqueta svg { width: 100%; height: 11mm; margin-top: 2px; }

@media print {
  body * { visibility: hidden; }
  #area-impressao, #area-impressao * { visibility: visible; }
  #area-impressao {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
  }
  .etiqueta { border-color: #000; }
}
