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

:root {
  --navy-950: #0a2740;
  --navy-900: #0E3554;
  --navy-800: #15476f;
  --navy-700: #1c5b8e;
  --navy-600: #2b74b6;
  --navy-100: #dae8f6;

  --red-700: #cb0f16;
  --red-650: #d4151c;
  --red-600: #E1262D;
  --red-500: #ef3b41;
  --red-300: #ffd1d2;

  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --ink: #0F1E3D;
  --muted: #5C6B84;
  --border: #E2E8F0;

  --g-navy: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 55%, var(--navy-700) 100%);
  --g-navy-soft: linear-gradient(180deg, #f9fbff 0%, #f6f9ff 100%);
  --g-red: linear-gradient(180deg, #ff5a60 0%, var(--red-600) 45%, var(--red-700) 100%);

  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 12px;
  --shadow-1: 0 2px 10px rgba(14, 53, 84, .08);
  --shadow-2: 0 10px 30px rgba(14, 53, 84, .12);
  --ring: 0 0 0 3px rgba(28, 91, 142, .28);

  --ff-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  --ff-title: "Poppins", var(--ff-ui);
  --fs-sm: .9rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.35rem;

  --container: 1360px;
  --aside: 360px;
  --gap: 24px;

  --logo-size: 100px;
}

*,
*::before,
*::after {
  box-sizing: border-box
}

html {
  scroll-behavior: smooth
}

body {
  margin: 0;
  font-family: var(--ff-ui);
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(28, 91, 142, .08), transparent 60%),
    radial-gradient(900px 500px at 100% 0, rgba(14, 53, 84, .06), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--navy-700);
  text-decoration: none
}

a:hover {
  text-decoration: underline
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0
}

.sr-only.sr-only-focusable:focus {
  position: static !important;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 32px
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--g-navy);
  color: #fff;
  box-shadow: var(--shadow-2);
  backdrop-filter: saturate(1.15) blur(4px);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 12px
}

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

.brand img{
  width: var(--logo-size);
  height: var(--logo-size);
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.28));
}


.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px
}

.brand-title {
  font: 700 var(--fs-lg)/1.1 var(--ff-title);
  letter-spacing: .2px
}

.brand-sub {
  font-size: .82rem;
  opacity: .92
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap
}

.btn-group {
  display: flex;
  gap: 8px
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: .92rem;
  transition: .2s ease;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring)
}

.btn:hover {
  transform: translateY(-1px)
}

.btn--primary {
  background: var(--g-red);
  color: #fff;
  border: 0
}

.btn--primary:hover {
  filter: brightness(.98)
}

.btn--secondary {
  background: #ffffff18;
  color: #fff;
  border-color: #ffffff30
}

.btn--secondary:hover {
  background: #ffffff28
}

.btn--ghost {
  background: transparent;
  color: #fff;
  border-color: #ffffff30
}

.btn--ghost:hover {
  background: #ffffff14
}

.layout {
  padding-block: 28px
}

.layout>.container {
  display: grid;
  grid-template-columns: var(--aside) 1fr;
  gap: var(--gap);
  align-items: start;
  min-height: calc(100svh - 90px);
}

@media (max-width:1100px) {
  .layout>.container {
    grid-template-columns: 1fr
  }
}

.lista-relatorios {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2);
  padding: 18px;
  height: fit-content;
  position: sticky;
  top: 96px;
}

.aside-head {
  display: grid;
  gap: 10px;
  margin-bottom: 12px
}

.lista-relatorios h2 {
  margin: 0;
  font: 700 var(--fs-xl)/1.2 var(--ff-title);
  color: var(--navy-900)
}

.search-group {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px
}

#filtroLista {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff
}

#listaRelatorios {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 8px
}

#listaRelatorios li {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: .18s ease;
  box-shadow: 0 1px 0 rgba(14, 53, 84, .04);
}

#listaRelatorios li:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(14, 53, 84, .10)
}

#listaRelatorios li[aria-selected="true"] {
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px #1c5b8e33
}

.conteudo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2);
  padding: 28px;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: #fff;
  padding: 20px 18px;
  margin: 0 0 var(--gap);
  box-shadow: var(--shadow-1);
  background-image: var(--g-navy-soft);
}

legend {
  font: 700 var(--fs-lg)/1.1 var(--ff-title);
  color: var(--navy-900);
  padding: 0 6px;
  letter-spacing: .2px
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 22px;
  row-gap: 18px;
  align-items: start;
}

.grid>label {
  grid-column: span 4;
  align-self: center;
  color: var(--muted);
  font-weight: 600;
  font-size: var(--fs-sm)
}

.grid>input:not([type="checkbox"]),
.grid>select,
.grid>textarea {
  grid-column: span 8
}

.grid .full {
  grid-column: 1/-1
}



@media (max-width:1024px) {
  .grid>label {
    grid-column: span 12
  }

  .grid>input:not([type="checkbox"]),
  .grid>select,
  .grid>textarea {
    grid-column: span 12
  }
}

input[type="text"],
input[type="date"],
input[type="number"],
input:not([type]),
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease, transform .06s ease;
}

input::placeholder,
textarea::placeholder {
  color: #8a98b1
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--navy-700);
  box-shadow: var(--ring)
}

input:hover,
select:hover,
textarea:hover {
  transform: translateY(-1px)
}


/* Espaço acima do botão Adicionar Amostra */
#amostras+#btnAddAmostra {
  margin-top: 14px;
  display: inline-flex;
  align-self: start;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--navy-700) 50%),
    linear-gradient(135deg, var(--navy-700) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(1em + 2px), calc(100% - 13px) calc(1em + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.hint {
  grid-column: span 12;
  font-size: .9rem;
  color: var(--muted);
  background: #f7f9fc;
  border: 1px dashed var(--border);
  padding: 10px 12px;
  border-radius: 12px;
}

.inline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap
}

.tabela-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: auto;
  background: #fff;
  box-shadow: var(--shadow-1)
}

.tabela {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px
}

.tabela thead th {
  position: sticky;
  top: 0;
  background: var(--g-navy);
  color: #fff;
  text-align: left;
  font-size: .9rem;
  font-weight: 700;
  padding: 12px 14px;
  letter-spacing: .2px;
}

.tabela tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #fff
}

.tabela tbody tr:nth-child(2n) td {
  background: #f9fbff
}

.tabela tbody tr:hover td {
  background: #f3f8ff
}

.tabela th:last-child,
.tabela td:last-child {
  width: 1%;
  white-space: nowrap
}

.conteudo .btn {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--navy-900)
}

.conteudo .btn--primary {
  background: var(--g-red);
  color: #fff;
  border-color: transparent
}

.conteudo .btn--primary:hover {
  filter: brightness(.98)
}

.conteudo .btn--secondary:hover {
  background: #f2f6fb
}

.rodape {
  margin-top: 28px;
  padding: 16px 0 22px;
  color: #fff;
  background: var(--g-navy);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.rodape small {
  display: block;
  text-align: center;
  opacity: .92
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 10px
}

[disabled],
:disabled {
  cursor: not-allowed !important;
  opacity: .65
}

@media (max-width:1360px) {
  .container {
    padding-inline: 24px
  }
}

@media (max-width:1100px) {
  .lista-relatorios {
    position: static;
    top: auto
  }
}

@media print {
  body {
    background: #fff
  }

  .topbar,
  .lista-relatorios,
  .actions,
  .btn,
  .no-print {
    display: none !important
  }

  .conteudo,
  fieldset {
    border-color: #bbb;
    box-shadow: none
  }

  .tabela thead th {
    background: #eee !important;
    color: #000 !important
  }
}

/* ===== 1) Corrige campo que "sai" da margem ===== */
fieldset {
  padding: 24px
}

/* dá mais respiro interno */
.grid>* {
  min-width: 0
}

/* evita overflow de inputs longos */
input:hover,
select:hover,
textarea:hover {
  transform: none
    /* não desloca 1px ao passar o mouse */
}

/* Focus confortável sem “vazar” a borda do card */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(28, 91, 142, .28);
  outline-offset: 2px;
  box-shadow: none;
  border-color: var(--navy-700);
}


#amostras+#btnAddAmostra {
  margin-top: 18px;
  display: inline-flex;
  align-self: start;
}

#listaRelatorios {
  gap: 10px;
}

#listaRelatorios li {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  border-radius: 14px;
  background: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(28, 91, 142, .08),
    0 8px 22px rgba(14, 53, 84, .10);
  border: 1px solid var(--border);
}

#listaRelatorios li strong {
  font-weight: 700;
  color: var(--ink);
}

#listaRelatorios li .meta {
  font-size: .82rem;
  color: var(--muted);
}

#listaRelatorios li .row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-mini {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--navy-900);
  font-weight: 600;
  font-size: .82rem;
  padding: 6px 12px;
  line-height: 1;
  border-radius: 999px;
  transition: .18s ease;
  box-shadow: 0 1px 0 rgba(14, 53, 84, .05);
}

.btn-mini:hover {
  background: #f6f9ff;
  border-color: #c9d6e6;
  transform: translateY(-1px);
}

.btn-mini:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(28, 91, 142, .18);
}

.btn-mini.danger {
  color: var(--red-600);
  border-color: #f1c6c9;
  background: linear-gradient(#fff, #fff);
}

.btn-mini.danger:hover {
  background: #fff6f7;
  border-color: #e9a7ad;
}