:root {
  --bg: #f3ebe3;
  --bg-deep: #ebe1d6;
  --surface: #fbf7f2;
  --surface-soft: #f4ece4;
  --sidebar: #4a3c34;
  --sidebar-elevated: #56463d;
  --sidebar-text: #efe6dc;
  --sidebar-muted: #b5a496;
  --accent: #9a6b4f;
  --accent-soft: rgba(154, 107, 79, 0.14);
  --accent-hover: #855a41;
  --line: #e0d3c5;
  --line-strong: #cdbba9;
  --text: #3a2f28;
  --muted: #7d6c5e;
  --danger: #8f2f24;
  --danger-soft: #f3e4df;
  --ok: #3f6b48;
  --warn: #8a5a10;
  --warn-soft: #f1e6d4;
  --radius: 4px;
  --radius-lg: 6px;
  --shadow: 0 1px 2px rgba(74, 60, 52, 0.05), 0 6px 16px rgba(74, 60, 52, 0.06);
  --font: "Source Sans 3", "Segoe UI", sans-serif;
  --font-display: "Source Serif 4", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(154, 107, 79, 0.1), transparent 36%),
    linear-gradient(180deg, #faf4ee 0%, var(--bg) 48%, var(--bg-deep) 100%);
  -webkit-font-smoothing: antialiased;
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 200px minmax(0, 1080px);
  justify-content: center;
  min-height: 100vh;
  width: min(1280px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  box-shadow: 0 0 0 1px rgba(74, 60, 52, 0.04), 0 12px 40px rgba(74, 60, 52, 0.08);
}

.sidebar {
  background:
    linear-gradient(180deg, var(--sidebar-elevated) 0%, var(--sidebar) 100%);
  color: var(--sidebar-text);
  padding: 0.9rem 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.brand {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  padding: 0.1rem 0.35rem 0.65rem;
  border-bottom: 1px solid rgba(217, 205, 193, 0.14);
}

.brand-mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 3px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #f7f1ea;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
}

.brand strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: #f4ece4;
}

.brand small {
  display: block;
  margin-top: 0.05rem;
  color: var(--sidebar-muted);
  font-size: 0.66rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.nav-link {
  color: inherit;
  text-decoration: none;
  padding: 0.46rem 0.6rem;
  border-radius: 3px;
  border-left: 2px solid transparent;
  font-weight: 500;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.nav-link .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.12rem;
  height: 1.12rem;
  flex: 0 0 auto;
  opacity: 0.72;
  color: #d9cdc1;
}

.nav-link .nav-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.nav-link:hover {
  background: rgba(244, 236, 228, 0.06);
  color: #f7f1ea;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
  opacity: 1;
  color: #e8d5c4;
}

.nav-link.active {
  background: rgba(154, 107, 79, 0.32);
  border-left-color: #c08968;
  color: #f7f1ea;
}

.sidebar-foot {
  margin-top: auto;
  font-size: 0.72rem;
  color: var(--sidebar-muted);
  padding: 0.55rem 0.45rem 0.2rem;
  border-top: 1px solid rgba(217, 205, 193, 0.14);
  line-height: 1.4;
}

.user-session {
  margin-bottom: 0.55rem;
  padding: 0.45rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.user-session strong {
  display: block;
  color: #f4ece4;
  font-size: 0.82rem;
}

.user-session small {
  display: block;
  color: var(--sidebar-muted);
  font-size: 0.7rem;
}

.check-admin {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.55rem;
  font-size: 0.9rem;
}

.main {
  padding: 1.05rem 1.2rem 1.4rem;
  width: 100%;
  max-width: none;
  min-width: 0;
}

.page-header {
  margin-bottom: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.home-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.home-welcome-text {
  min-width: 0;
}

.home-welcome-avatar {
  flex: 0 0 auto;
  width: 4.6rem;
  height: 4.6rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(154, 107, 79, 0.35);
  background: #f3ebe3;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.home-welcome-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-avatar-fallback {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--accent);
}

.perfil-foto-box {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.perfil-foto-preview {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f3ebe3;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.perfil-foto-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.perfil-foto-placeholder {
  font-size: 0.82rem;
  color: var(--muted);
}

.perfil-foto-actions {
  min-width: 14rem;
  flex: 1 1 16rem;
}

.page-header h1 {
  margin: 0 0 0.15rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}

.page-header p {
  margin: 0;
  color: var(--muted);
  max-width: 36rem;
  font-size: 0.86rem;
  line-height: 1.35;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.55rem;
}

.home-shortcuts {
  grid-template-columns: repeat(2, minmax(220px, 340px));
  max-width: 720px;
}

.home-shortcuts .module-card {
  min-height: 9.5rem;
}

.home-chart-panel {
  margin-top: 0.9rem;
}

.home-charts-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
  align-items: start;
}

.home-charts-row .home-chart-panel {
  margin-top: 0;
  min-width: 0;
}

.home-charts-row .bar-chart-row {
  grid-template-columns: 1.4rem minmax(5rem, 1fr) 1fr minmax(4.8rem, 6.2rem);
  gap: 0.4rem;
}

.bar-chart-fill-prod {
  background: linear-gradient(90deg, #6f5a48 0%, #a67c5b 100%);
}

@media (max-width: 980px) {
  .home-charts-row {
    grid-template-columns: 1fr;
  }
}

.faturamento-atual {
  display: grid;
  gap: 0.15rem;
  margin: 0.55rem 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbf7f2;
  max-width: 22rem;
}

.faturamento-atual strong {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  color: var(--accent);
}

.faturamento-atual small {
  color: var(--muted);
  font-size: 0.78rem;
}

.year-bar-chart {
  margin-top: 0.2rem;
}

.year-bars {
  display: grid;
  grid-template-columns: repeat(var(--cols, 8), minmax(0, 1fr));
  gap: 0.55rem;
  align-items: end;
  min-height: 14rem;
  padding: 0.35rem 0.15rem 0.2rem;
}

.year-bar-item {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.35rem;
  min-height: 12.5rem;
  text-align: center;
}

.year-bar-value {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.2;
  min-height: 1.7rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.year-bar-col {
  height: 9.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 6px 6px 2px 2px;
  background: rgba(154, 107, 79, 0.08);
  padding: 0 18%;
}

.year-bar-fill {
  width: 100%;
  border-radius: 5px 5px 1px 1px;
  background: linear-gradient(180deg, #c08968 0%, #9a6b4f 100%);
  transition: height 0.45s ease;
  min-height: 0;
}

.year-bar-item.is-atual .year-bar-fill {
  background: linear-gradient(180deg, #d4a07a 0%, #8a5638 100%);
  box-shadow: 0 0 0 1px rgba(138, 86, 56, 0.25);
}

.year-bar-item.is-atual .year-bar-label {
  font-weight: 700;
  color: var(--accent);
}

.year-bar-item.is-atual .year-bar-value {
  color: var(--ink);
  font-weight: 600;
}

.year-bar-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

@media (max-width: 820px) {
  .year-bars {
    gap: 0.35rem;
    min-height: 12rem;
  }

  .year-bar-item {
    min-height: 11rem;
  }

  .year-bar-col {
    height: 7.5rem;
    padding: 0 12%;
  }

  .year-bar-value {
    font-size: 0.6rem;
    writing-mode: horizontal-tb;
  }
}

.home-bar-chart {
  margin-top: 0.35rem;
}

.bar-chart-list {
  display: grid;
  gap: 0.42rem;
}

.bar-chart-row {
  display: grid;
  grid-template-columns: 1.6rem minmax(7rem, 14rem) 1fr minmax(5.5rem, 7rem);
  gap: 0.55rem;
  align-items: center;
}

.bar-chart-rank {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
}

.bar-chart-label {
  display: grid;
  gap: 0.05rem;
  font-size: 0.82rem;
  font-weight: 500;
  overflow: hidden;
  min-width: 0;
}

.bar-chart-label > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-chart-code {
  font-size: 0.68rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-chart-track {
  height: 0.72rem;
  border-radius: 999px;
  background: rgba(154, 107, 79, 0.12);
  overflow: hidden;
}

.bar-chart-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9a6b4f 0%, #c08968 100%);
  min-width: 0.35rem;
  transition: width 0.45s ease;
}

.bar-chart-value {
  display: grid;
  justify-items: end;
  line-height: 1.15;
}

.bar-chart-value strong {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.bar-chart-value small {
  font-size: 0.68rem;
  color: var(--muted);
}

@media (max-width: 820px) {
  .home-shortcuts {
    grid-template-columns: 1fr;
    max-width: 360px;
  }

  .bar-chart-row {
    grid-template-columns: 1.4rem 1fr auto;
    grid-template-areas:
      "rank label value"
      "track track track";
  }

  .bar-chart-rank { grid-area: rank; }
  .bar-chart-label { grid-area: label; }
  .bar-chart-value { grid-area: value; }
  .bar-chart-track { grid-area: track; }
}

.module-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0.85rem 0.85rem 0.8rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 0.18s ease, transform 0.18s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  margin-bottom: 0.45rem;
  color: var(--accent);
  opacity: 0.78;
  flex: 0 0 auto;
}

.card-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.module-card:hover .card-icon {
  opacity: 1;
}

.choice-card .card-icon {
  width: 1.9rem;
  height: 1.9rem;
  margin-bottom: 0.55rem;
  opacity: 0.85;
}

.module-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.module-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.module-card:hover::before {
  opacity: 1;
}

.module-card h2 {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
}

.module-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.module-card .count {
  display: inline-block;
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 0.75rem 0.8rem 0.85rem;
  margin-bottom: 0.65rem;
}

.panel h2 {
  margin: 0 0 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.65rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.52rem 0.62rem;
  font: inherit;
  font-size: 0.9rem;
  background: #fbf7f2;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--line-strong);
}

.field textarea {
  min-height: 4.2rem;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fffdfb;
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.field input[readonly] {
  background: #ebe3da;
  color: #5d4f44;
}

.actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
}

.btn {
  border: 0;
  border-radius: var(--radius);
  padding: 0.52rem 0.85rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  background: var(--accent);
  color: #f8f1ea;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.12s ease;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn:active {
  transform: translateY(1px);
}

.btn.secondary {
  background: #e5d9cc;
  color: var(--text);
}

.btn.secondary:hover {
  background: #d9c9b8;
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.btn.danger:hover {
  background: #74261d;
}

.btn-sm {
  padding: 0.3rem 0.52rem;
  font-size: 0.76rem;
  font-weight: 600;
}

.row-actions {
  display: flex;
  gap: 0.28rem;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.1rem;
  padding: 0.12rem 0.38rem;
  border-radius: 2px;
  background: #e5d9cc;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mode-badge.edit {
  background: var(--warn-soft);
  color: var(--warn);
}

.msg {
  font-size: 0.86rem;
  min-height: 1rem;
}

.msg.ok {
  color: var(--ok);
}

.msg.err {
  color: var(--danger);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  text-align: left;
  padding: 0.58rem 0.6rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #f1e9e0;
}

th {
  background: #ebe2d7;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 60, 52, 0.45);
  display: grid;
  place-items: center;
  padding: 0.85rem;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: min(500px, 100%);
  max-height: min(84vh, 680px);
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: 0 14px 36px rgba(74, 60, 52, 0.24);
  padding: 0.9rem 0.95rem 1rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
}

.modal-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
}

.modal-close {
  border: 0;
  background: transparent;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.modal-lead {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.modal-details {
  display: grid;
  gap: 0.4rem;
  padding: 0.65rem;
  border-radius: var(--radius);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.detail-row {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 0.4rem;
  align-items: start;
}

.detail-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: var(--muted);
  padding-top: 0.1rem;
}

.detail-value {
  font-size: 0.9rem;
  word-break: break-word;
  white-space: pre-wrap;
}

.detail-value .empty {
  color: #9a8a7a;
  font-style: italic;
}

.modal-warn {
  margin: 0.7rem 0 0;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius);
  background: var(--danger-soft);
  border: 1px solid #dfc0b8;
  color: #74261d;
  font-size: 0.86rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.field-hint {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.muted {
  color: var(--muted);
  margin: 0;
  font-size: 0.86rem;
}

.table-wrap table tbody tr.row-click {
  cursor: pointer;
}

.table-wrap table tbody tr.row-click:hover td {
  background: #ebe0d4;
}

.choice-card {
  padding: 1.15rem 1.1rem 1.05rem;
  border: 1.5px solid var(--accent);
  background:
    linear-gradient(180deg, #fbf6f0 0%, #f5ebe2 100%);
  box-shadow: 0 2px 0 rgba(154, 107, 79, 0.12), 0 8px 20px rgba(74, 60, 52, 0.08);
}

.choice-card::before {
  width: 4px;
  opacity: 1;
}

.choice-card h2 {
  font-size: 1.22rem;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.choice-card p {
  font-size: 0.9rem;
  color: #6d5b4e;
  line-height: 1.4;
}

.choice-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-hover);
  background:
    linear-gradient(180deg, #fffdf9 0%, #f3e8dc 100%);
  box-shadow: 0 4px 0 rgba(154, 107, 79, 0.14), 0 12px 26px rgba(74, 60, 52, 0.1);
}

.choice-card:active {
  transform: translateY(-1px);
}

.choice-card-featured {
  border-width: 2px;
  border-color: var(--accent);
  background:
    linear-gradient(135deg, #fff8f0 0%, #f0ddd0 48%, #e8d0c0 100%);
  box-shadow: 0 3px 0 rgba(154, 107, 79, 0.18), 0 14px 28px rgba(74, 60, 52, 0.12);
}

a.module-card {
  text-decoration: none;
  color: inherit;
}

.choice-card-featured:hover {
  border-color: var(--accent-hover);
  background:
    linear-gradient(135deg, #fffdf9 0%, #f5e4d6 48%, #ecd6c4 100%);
}

.hidden {
  display: none !important;
}

.panel h2 {
  flex-wrap: wrap;
}

.vinculo-ficha {
  display: grid;
  gap: 0.4rem;
  padding: 0.65rem 0.7rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.vinculo-grid {
  display: grid;
  gap: 0.75rem;
}

.vinculo-bloco h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

.itens-box {
  margin-top: 1rem;
  padding: 0.85rem 0.9rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.itens-box h3 {
  margin: 0 0 0.7rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

.itens-add {
  display: grid;
  grid-template-columns: 1fr 100px 120px auto;
  gap: 0.55rem;
  align-items: end;
  margin-bottom: 0.75rem;
}

.itens-add .field {
  gap: 0.25rem;
}

.itens-add .field label {
  font-size: 0.66rem;
}

.itens-add .field input,
.itens-add .field select {
  padding: 0.42rem 0.52rem;
  font-size: 0.84rem;
}

.itens-total {
  margin: 0.7rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
  text-align: right;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 0 0.9rem;
}

.report-summary > div {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbf7f2;
  display: grid;
  gap: 0.2rem;
}

.report-summary strong {
  font-size: 1.05rem;
  font-family: var(--font-mono);
  color: var(--ink);
}

@media print {
  .sidebar,
  .btn-voltar-hub,
  .actions,
  .page-header p {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .main {
    padding: 0;
  }

  .report-panel {
    border: 0;
    box-shadow: none;
  }

  .report-summary > div {
    background: transparent;
  }
}

.anexo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbf7f2;
}

.anexo-meta {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.anexo-meta strong {
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anexo-meta span {
  font-size: 0.76rem;
  color: var(--muted);
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: min(820px, 100%);
  }

  .sidebar {
    gap: 0.65rem;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav-link {
    border-left: 0;
    border-bottom: 2px solid transparent;
  }

  .nav-link.active {
    border-bottom-color: #c08968;
  }

  .main {
    padding: 0.8rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .itens-add {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .home-welcome-avatar {
    width: 3.6rem;
    height: 3.6rem;
  }

  .home-avatar-fallback {
    font-size: 1.25rem;
  }

  .app-shell {
    width: 100%;
    border-left: 0;
    border-right: 0;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .anexo-item {
    flex-direction: column;
    align-items: stretch;
  }

  .itens-add {
    grid-template-columns: 1fr;
  }
}
