:root {
  --bg: #f4f4ee;
  --card: #ffffff;
  --ink: #1f2a22;
  --ink-soft: #496153;
  --brand: #00724a;
  --brand-dark: #005236;
  --line: #d7ded6;
  --danger: #b92929;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at top right, #dfe9db, var(--bg) 45%);
  color: var(--ink);
}

.app-header {
  padding: 1rem;
  background: linear-gradient(120deg, var(--brand), #3f8e4a);
  color: #fff;
}

.app-header h1 {
  margin: 0;
  font-size: 1.2rem;
}

.header-user {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

.app-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 0.9rem;
}

.menu-mobile {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.menu-mobile a {
  text-decoration: none;
  text-align: center;
  padding: 0.65rem;
  border-radius: 0.55rem;
  color: var(--brand-dark);
  background: #e7f2e8;
  font-weight: 600;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.95rem;
  margin-bottom: 0.9rem;
  box-shadow: 0 5px 14px rgba(29, 52, 41, 0.06);
}

h2 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
}

.form-grid {
  display: grid;
  gap: 0.45rem;
}

label {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

input,
select,
textarea,
button,
.button {
  width: 100%;
  border-radius: 0.55rem;
  border: 1px solid var(--line);
  padding: 0.68rem;
  font: inherit;
}

button,
.button {
  border: none;
  background: var(--brand);
  color: #fff;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}

button:hover,
.button:hover {
  background: var(--brand-dark);
}

.secondary {
  background: #dfe8df;
  color: #234e33;
}

.secondary:hover {
  background: #cedccf;
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.85rem;
}

.messages {
  margin-bottom: 0.75rem;
}

.message {
  padding: 0.65rem;
  border-radius: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.message.success {
  background: #e2f4e7;
  color: #1c5f30;
}

.message.warning,
.message.error {
  background: #fbe9e9;
  color: #9f2222;
}

.input-with-button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
}

.input-with-button button {
  width: auto;
  white-space: nowrap;
}

.dados-patrimonio {
  background: #f8faf5;
  border: 1px solid #dce5d8;
  border-radius: 0.6rem;
  padding: 0.6rem;
}

.dados-patrimonio p {
  margin: 0.35rem 0;
  font-size: 0.92rem;
}

.hidden {
  display: none;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  border-bottom: 1px solid #ebefea;
  text-align: left;
  padding: 0.5rem;
  font-size: 0.86rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 35, 28, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: min(540px, 100%);
  background: #fff;
  border-radius: 0.7rem;
  padding: 0.9rem;
}

#reader {
  width: 100%;
  min-height: 250px;
}

@media (min-width: 768px) {
  .app-header h1 {
    font-size: 1.45rem;
  }

  .form-grid.inline-filters {
    grid-template-columns: repeat(2, 1fr);
    align-items: end;
  }
}
