:root {
  --bg: #f4f7f9;
  --surface: #ffffff;
  --surface-soft: #eef4f3;
  --text: #17202a;
  --muted: #65717c;
  --line: #dce5e8;
  --primary: #176b87;
  --primary-dark: #0f5368;
  --accent: #d9863d;
  --ok: #25845c;
  --warn: #c47b16;
  --bad: #b83a3a;
  --info: #466fb1;
  font-family: "Segoe UI Variable", "Segoe UI", Inter, Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: 260px 1fr;
  font-size: 16px;
  line-height: 1.45;
}

.auth-locked .sidebar,
.auth-locked .shell {
  display: none;
}

.auth-gate {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: linear-gradient(145deg, #0c2731, #164b5c);
}

.auth-gate[hidden] {
  display: none;
}

.auth-card {
  width: min(100%, 430px);
  padding: 28px;
  border-radius: 16px;
  background: white;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.auth-card > img {
  display: block;
  width: min(100%, 310px);
  max-height: 105px;
  margin: 0 auto 22px;
  object-fit: contain;
}

.auth-card h1 {
  font-size: 25px;
  text-align: center;
}

.auth-card p {
  margin: 7px 0 20px;
  color: var(--muted);
  text-align: center;
}

.auth-card form {
  display: grid;
  gap: 14px;
}

.auth-card form button {
  margin-top: 4px;
}

.auth-card .auth-message {
  min-height: 21px;
  margin: 14px 0 0;
  color: var(--bad);
  font-size: 14px;
  font-weight: 700;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.file-button {
  border: 0;
  background: var(--primary);
  color: white;
  min-height: 40px;
  border-radius: 9px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

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

button:active,
.file-button:active {
  transform: translateY(1px);
}

button:focus-visible,
.file-button:focus-within,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(23, 107, 135, 0.24);
  outline-offset: 2px;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.secondary {
  background: #e6edf0;
  color: var(--text);
  border: 1px solid var(--line);
}

.secondary:hover {
  background: #d9e4e8;
}

.sidebar {
  background: #102a33;
  color: white;
  min-height: 100vh;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.brand-symbol {
  display: grid;
  place-items: center;
  flex: 1 1 auto;
  width: 100%;
  height: 86px;
  padding: 6px 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff, #eef3f5);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.brand-logo[hidden],
.brand-mark[hidden] {
  display: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  font-weight: 900;
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong,
.brand-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  display: block;
  color: #bfd0d4;
  margin-top: 3px;
}

.nav {
  display: grid;
  gap: 20px;
  margin-top: 28px;
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-group-title {
  padding: 0 12px 4px;
  color: #89a6ae;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  color: #d8e5e8;
  text-align: left;
  border-radius: 9px;
  padding: 11px 12px;
  font-weight: 700;
  overflow: hidden;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 24px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
  opacity: 0;
  transform: translateY(-50%) scaleY(0.4);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.nav-item:hover,
.nav-item.active {
  background: #1f4652;
  color: white;
}

.nav-item.active::before {
  opacity: 1;
  transform: translateY(-50%) scaleY(1);
}

.nav-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}

.menu-toggle {
  display: none;
  flex: 0 0 42px;
  width: 42px;
  padding: 9px;
  border: 1px solid #31535d;
  background: #173943;
}

.menu-toggle:hover {
  background: #1f4652;
}

.menu-toggle svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

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

.shell {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(300px, 620px) minmax(230px, 1fr);
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar-copy {
  min-width: 0;
}

.topbar-filters {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(200px, 240px);
  align-items: end;
  justify-content: center;
  gap: 14px;
  min-width: 0;
}

body:not([data-view="dashboard"]) .topbar-filters {
  grid-template-columns: minmax(280px, 360px);
  width: min(100%, 360px);
  justify-self: center;
}

.topbar-filters[hidden],
.dashboard-filter[hidden],
.dashboard-reference[hidden],
#report-status-heading[hidden] {
  display: none;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

.topbar p {
  color: var(--muted);
  margin-top: 6px;
}

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

.file-button input {
  display: none;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.storage-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.current-user {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.logo-settings {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 250px minmax(240px, 360px);
  align-items: center;
  gap: 22px;
  margin-bottom: 16px;
}

.logo-settings p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.logo-settings img {
  display: block;
  width: 100%;
  height: 92px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  object-fit: contain;
}

.logo-settings form {
  display: grid;
  gap: 10px;
}

.storage-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
}

.storage-status.online::before {
  background: var(--ok);
}

.storage-status.offline::before {
  background: var(--bad);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.dashboard-reference {
  display: block;
  margin: 0;
}

.dashboard-reference .month-reference-field {
  width: 100%;
}

.dashboard-filter {
  width: 100%;
  max-width: none;
}

.profile-menu {
  position: relative;
  z-index: 20;
  grid-column: 3;
  justify-self: end;
}

.profile-menu > summary {
  list-style: none;
}

.profile-menu > summary::-webkit-details-marker {
  display: none;
}

.profile-trigger {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  place-items: center;
  background: white;
  color: var(--primary);
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(31, 55, 65, 0.08);
}

.profile-trigger:hover,
.profile-menu[open] .profile-trigger {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.profile-trigger svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-status-dot {
  position: absolute;
  right: 1px;
  bottom: 2px;
  width: 11px;
  height: 11px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--warn);
}

.profile-menu.online .profile-status-dot {
  background: var(--ok);
}

.profile-menu.offline .profile-status-dot {
  background: var(--bad);
}

.profile-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(280px, calc(100vw - 36px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 18px 44px rgba(16, 42, 51, 0.2);
}

.profile-identity {
  display: grid;
  gap: 7px;
  padding: 3px 5px 11px;
  border-bottom: 1px solid var(--line);
}

.profile-identity .current-user {
  overflow-wrap: anywhere;
  white-space: normal;
}

.profile-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding-top: 9px;
}

.profile-actions > button,
.profile-actions > .file-button {
  width: 100%;
}

.profile-action {
  display: flex;
  min-height: 40px;
  padding: 8px 10px;
  border-color: transparent;
  justify-content: flex-start;
  gap: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.profile-action:hover {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.profile-action svg {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-action span {
  min-width: 0;
}

.profile-install {
  background: rgba(23, 107, 135, 0.08);
  color: var(--primary-dark);
}

.profile-logout {
  margin-top: 5px;
  border-color: rgba(184, 58, 58, 0.12);
  background: rgba(184, 58, 58, 0.06);
  color: var(--bad);
}

.profile-logout:hover {
  border-color: rgba(184, 58, 58, 0.25);
  background: rgba(184, 58, 58, 0.1);
  color: #8f2424;
}

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(31, 55, 65, 0.055);
}

.metric {
  padding: 18px;
}

.metric-action {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  white-space: normal;
}

.metric-action:hover {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 9px 24px rgba(31, 55, 65, 0.11);
  transform: translateY(-1px);
}

.metric-action.waiting { border-top: 4px solid var(--warn); }
.metric-action.received { border-top: 4px solid var(--ok); }
.metric-action.denied { border-top: 4px solid var(--bad); }
.metric-action.waiting strong { color: var(--warn); }
.metric-action.received strong { color: var(--ok); }
.metric-action.denied strong { color: var(--bad); }

.metric span,
.metric small {
  color: var(--muted);
  display: block;
}

.metric strong {
  display: block;
  font-size: 28px;
  margin: 8px 0 4px;
}

.metric.warning strong {
  color: var(--warn);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.status-key {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.status-key span {
  display: inline-flex;
  align-items: center;
}

.status-key .dot {
  margin-right: 5px;
}

.wide {
  grid-column: 1 / -1;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

#visit-form .panel-head {
  justify-content: center;
}

#visit-form .panel-head h2 {
  width: 100%;
  text-align: center;
}

#visit-form .form-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#visit-form .form-actions button {
  width: 100%;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.two-column.compact {
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.patient-lookup-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.patient-lookup-status.existing {
  color: var(--ok);
}

.patient-lookup-status.new {
  color: var(--primary-dark);
}

.patient-lookup-status.warning {
  color: var(--warn);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  min-height: 42px;
  border-radius: 9px;
  padding: 10px 12px;
  background: white;
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

textarea {
  resize: vertical;
}

.span-2 {
  grid-column: 1 / -1;
}

.form-actions {
  margin-top: 16px;
}

.period-builder {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.period-builder button {
  grid-column: 1 / -1;
  width: 100%;
}

.period-list {
  display: grid;
  gap: 8px;
}

.period-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  font-size: 13px;
}

.period-entry .icon-btn {
  flex: 0 0 auto;
}

.period-entry small {
  margin-left: 6px;
  color: var(--primary-dark);
  font-weight: 800;
}

.period-empty {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow: auto;
  border-radius: 9px;
  scrollbar-gutter: stable;
}

.table-controls {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.table-controls label {
  min-width: 170px;
}

.visits-toolbar {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto auto;
  align-items: end;
}

.visits-toolbar h2 {
  align-self: center;
  justify-self: center;
  max-width: 120px;
  text-align: center;
}

.visits-toolbar .search {
  min-width: 0;
}

.visits-toolbar .visit-limit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.visits-toolbar .visit-limit select {
  width: 88px;
}

.month-reference-field {
  min-width: 230px;
}

.month-field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.month-picker {
  position: relative;
}

.month-picker-trigger {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--text);
  font-size: 14px;
  text-align: left;
}

.month-picker-trigger:hover,
.month-picker-trigger[aria-expanded="true"] {
  border-color: var(--primary);
  background: white;
  color: var(--text);
}

.month-picker-trigger:disabled,
.month-picker-trigger:disabled:hover {
  border-color: var(--line);
  background: #f1f4f5;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.78;
}

.month-picker-popover {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  right: 0;
  width: 278px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  box-shadow: 0 16px 34px rgba(15, 45, 54, 0.18);
}

.month-picker-year {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  margin-bottom: 8px;
  background: var(--surface-soft);
  border-radius: 7px;
}

.month-picker-year strong {
  text-align: center;
}

.month-picker-year button {
  min-height: 42px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 24px;
  line-height: 1;
}

.month-picker-months {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.month-picker-months button {
  min-height: 34px;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.month-picker-months button:hover {
  background: var(--surface-soft);
  color: var(--primary);
}

.month-picker-months button.active {
  background: var(--primary);
  color: white;
}

.month-picker-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.month-picker-footer button {
  min-height: 32px;
  padding: 5px 7px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
}

.visits-toolbar .pagination {
  justify-self: end;
  margin-left: 0;
}

.check-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
}

.check-toolbar .search {
  flex: 1 1 280px;
  width: auto;
  max-width: 520px;
}

.check-toolbar h2 {
  display: flex;
  flex: 0 0 auto;
  min-height: 42px;
  align-items: center;
  margin: 0;
}

.check-toolbar .month-reference-field,
.check-toolbar .check-limit {
  flex: 0 0 auto;
}

.check-toolbar .pagination {
  margin-left: 0;
}

.patient-toolbar {
  flex-wrap: wrap;
  align-items: center;
}

.patient-toolbar h2 {
  flex: 0 0 auto;
  margin: 0;
}

.patient-toolbar .search {
  flex: 1 1 220px;
  width: auto;
  max-width: 360px;
}

.patient-total {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.patient-limit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.patient-limit select {
  width: 88px;
}

.patient-toolbar .pagination {
  margin-left: 0;
}

.patient-list-layout,
.patient-list-panel {
  width: 100%;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.pagination span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.table-sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  min-height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-transform: inherit;
  justify-content: center;
  width: 100%;
}

.table-sort:hover {
  background: transparent;
  color: var(--primary);
}

.table-sort::after {
  content: "↕";
  color: #9aa8ae;
  font-size: 11px;
}

.visits-data-table th:not(:nth-child(2)),
.visits-data-table td:not(:nth-child(2)),
.conference-data-table th:not(:nth-child(2)):not(:nth-child(7)),
.conference-data-table td:not(:nth-child(2)):not(:nth-child(7)) {
  text-align: center;
}

.patients-data-table th:not(:nth-child(1)):not(:nth-child(5)),
.patients-data-table td:not(:nth-child(1)):not(:nth-child(5)) {
  text-align: center;
}

.table-wrap thead th {
  text-align: center;
}

.table-wrap th:last-child,
.table-wrap td:last-child,
.report-status-cell {
  text-align: center;
}

.table-wrap td:last-child .row-actions {
  justify-content: center;
}

#report-patients-table tr:not(.report-plan-group-row) td:not(:first-child) {
  text-align: center;
}

.visits-data-table td:last-child .row-actions {
  justify-content: center;
}

th[aria-sort="ascending"] .table-sort::after {
  content: "↑";
  color: var(--primary);
}

th[aria-sort="descending"] .table-sort::after {
  content: "↓";
  color: var(--primary);
}

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

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: var(--surface);
}

td {
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* Mantém os dados visualmente alinhados aos respectivos títulos em todas as tabelas. */
.table-wrap tbody td {
  text-align: center;
}

/* Colunas textuais longas são alinhadas à esquerda para facilitar a leitura. */
#medicos .table-wrap th:first-child,
#medicos .table-wrap td:first-child,
#pacientes .patients-data-table th:first-child,
#pacientes .patients-data-table td:first-child,
.visits-data-table th:nth-child(2),
.visits-data-table td:nth-child(2),
.conference-data-table th:nth-child(2),
.conference-data-table td:nth-child(2),
.conference-data-table th:nth-child(7),
.conference-data-table td:nth-child(7),
#relatorios .table-wrap thead th:first-child,
#report-patients-table tr:not(.report-plan-group-row) td:first-child {
  text-align: left;
}

.visits-data-table th:nth-child(2) .table-sort,
.conference-data-table th:nth-child(2) .table-sort,
.conference-data-table th:nth-child(7) .table-sort,
#relatorios .table-wrap thead th:first-child .table-sort {
  justify-content: flex-start;
}

.table-wrap thead th {
  position: sticky;
  z-index: 4;
  top: 0;
  box-shadow: inset 0 -1px 0 var(--line);
}

.table-wrap tbody tr:not(.report-plan-group-row) td {
  transition: background-color 0.15s ease;
}

.table-wrap tbody tr:not(.report-plan-group-row):not(.editing-row):not(.status-editing-row):hover td {
  background: #f3f8fa;
}

#visitas .table-wrap,
#relatorios .table-wrap {
  max-height: 68vh;
}

#visitas table {
  min-width: 1080px;
}

#relatorios table {
  min-width: 880px;
}

#planos table {
  min-width: 320px;
}

#visits-table tr.editing-row {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

#visits-table tr.editing-row td {
  background: #ffe8bd !important;
  border-bottom-color: #e8b36f;
}

#visits-table tr.editing-row td:first-child {
  box-shadow: inset 5px 0 0 var(--accent);
}

#visits-table tr.editing-row .icon-btn:first-child {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

#patients-table tr.editing-row {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

#patients-table tr.editing-row td {
  background: #ffe8bd !important;
  border-bottom-color: #e8b36f;
}

#patients-table tr.editing-row td:first-child {
  box-shadow: inset 5px 0 0 var(--accent);
}

#visits-table tr.status-editing-row td {
  background: #edf7f3;
}

#visits-table tr.status-editing-row {
  outline: 2px solid var(--ok);
  outline-offset: -2px;
}

.status-edit-trigger {
  border: 0;
  cursor: pointer;
}

.status-edit-trigger:hover {
  filter: brightness(0.95);
}

.visit-patient-cell {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.observation-indicator {
  display: inline-flex;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid #d9863d;
  border-radius: 50%;
  color: #8a4a12;
  background: #fff1db;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  cursor: help;
}

.observation-indicator:focus-visible {
  outline: 3px solid rgba(217, 134, 61, 0.3);
  outline-offset: 2px;
}

.status-reference-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.status-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.history-link {
  min-height: auto;
  padding: 1px 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.history-link:hover {
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.history-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  box-shadow: 0 24px 70px rgba(10, 34, 42, 0.28);
}

.edit-dialog {
  width: min(700px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--text);
  box-shadow: 0 24px 70px rgba(10, 34, 42, 0.28);
}

.edit-dialog::backdrop {
  background: rgba(10, 34, 42, 0.5);
  backdrop-filter: blur(2px);
}

.edit-dialog form {
  display: grid;
  gap: 18px;
}

.patient-edit-dialog {
  overflow: auto;
}

.status-edit-dialog {
  width: min(620px, calc(100vw - 32px));
  overflow: visible;
}

.duplicate-visit-dialog {
  width: min(640px, calc(100vw - 32px));
  padding: 24px;
  overflow: auto;
  border-top: 6px solid var(--warn);
}

.duplicate-alert-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  place-items: center;
  border-radius: 50%;
  background: #fff0cf;
  color: #805600;
  font-size: 32px;
  font-weight: 900;
}

.duplicate-alert-content {
  text-align: center;
}

.duplicate-alert-content > p {
  margin-top: 7px;
  color: var(--muted);
}

.duplicate-visit-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
  text-align: left;
}

.duplicate-visit-details > div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.duplicate-visit-details dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.duplicate-visit-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.duplicate-alert-note {
  font-size: 13px;
  font-weight: 700;
}

.duplicate-dialog-actions {
  justify-content: center;
  margin-top: 18px;
}

.duplicate-dialog-actions button {
  min-width: 180px;
}

.duplicate-confirm {
  border-color: #e4a1a1;
  color: var(--bad);
}

.duplicate-confirm:hover {
  border-color: var(--bad);
  background: #fff2f2;
  color: var(--bad);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.dialog-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.status-dialog-heading {
  position: relative;
  justify-content: center;
  padding-right: 42px;
  padding-left: 42px;
  text-align: center;
}

.status-dialog-heading > div {
  width: 100%;
}

.status-dialog-heading .dialog-close {
  position: absolute;
  top: 0;
  right: 0;
}

.dialog-close {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  place-items: center;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.dialog-close:hover {
  background: #e3ecef;
  color: var(--text);
}

.dialog-actions {
  justify-content: flex-end;
  padding-top: 2px;
}

.status-edit-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(230px, 1.2fr);
  align-items: end;
  gap: 14px;
}

.status-edit-fields .month-reference-field {
  min-width: 0;
}

.status-edit-fields .month-reference-field.is-disabled .month-field-label {
  color: #8a969c;
}

.report-status-cell .badge {
  display: inline-flex;
}

.report-status-reference {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.history-dialog::backdrop {
  background: rgba(10, 34, 42, 0.5);
}

.history-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.history-dialog-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.history-dialog table {
  min-width: 620px;
}

.icon-btn.save-inline {
  background: var(--ok);
  border-color: var(--ok);
  color: white;
}

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.icon-btn {
  min-height: 34px;
  padding: 7px 9px;
  background: #eef4f3;
  color: var(--text);
  border: 1px solid var(--line);
}

.icon-btn:hover {
  border-color: #c8d9de;
  background: #dfeaec;
  color: var(--text);
}

.icon-btn.save-inline:hover {
  border-color: #1d704d;
  background: #1d704d;
  color: white;
}

.icon-btn.delete {
  border-color: #efcccc;
  background: #fff7f7;
  color: var(--bad);
}

.icon-btn.delete:hover {
  border-color: var(--bad);
  background: var(--bad);
  color: white;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #eef4f3;
}

.badge.ok {
  color: #17633c;
  background: #e5f4ed;
}

.badge.warn {
  color: #805600;
  background: #fff1db;
}

.badge.bad {
  color: #8b2727;
  background: #fde8e8;
}

.badge.info {
  color: var(--info);
  background: #e8eefb;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.conference-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.conference-summary > small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.legend-item strong {
  display: inline-grid;
  min-width: 25px;
  min-height: 22px;
  place-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: white;
  color: var(--text);
  font-size: 13px;
}

.legend-item.received { border-color: rgba(37, 132, 92, 0.28); }
.legend-item.waiting { border-color: rgba(217, 134, 61, 0.32); }
.legend-item.denied { border-color: rgba(194, 79, 112, 0.3); }

button.legend-item {
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}

button.legend-item:hover,
button.legend-item.active {
  background: #e8f1f4;
  color: var(--text);
}

button.legend-item.active {
  box-shadow: inset 0 0 0 2px var(--primary);
}

.conference-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.check-limit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.check-limit select {
  width: 88px;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}

.dot.ok {
  background: var(--ok);
}

.dot.warn {
  background: var(--warn);
}

.dot.bad {
  background: var(--bad);
}

.dot.info {
  background: var(--info);
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 5px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e7eef1;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
}

.status-bar-scale {
  display: flex;
  height: 100%;
  min-width: 3px;
  overflow: hidden;
  border-radius: inherit;
}

.status-segment {
  display: block;
  flex: 0 0 var(--segment-size);
}

.status-segment.received { background: var(--ok); }
.status-segment.waiting { background: var(--warn); }
.status-segment.denied { background: var(--bad); }

.report-panel {
  display: grid;
  gap: 18px;
}

.report-panel .panel-head {
  margin-bottom: 0;
}

.report-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  text-align: center;
}

.report-heading > div:first-child {
  grid-column: 2;
}

.report-heading .report-actions {
  grid-column: 3;
  justify-self: end;
}

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

.report-heading p {
  margin: 5px 0 0;
  color: var(--muted);
}

.report-reference {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.report-type-field {
  display: grid;
  gap: 6px;
}

.report-type-options {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
}

.report-type-option {
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
}

.report-type-option:hover {
  border-color: var(--primary);
  background: #f5f9fa;
  color: var(--text);
}

.report-type-option.all.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.report-type-option.closed.active {
  border-color: var(--ok);
  background: var(--ok);
  color: white;
}

.report-type-option.open.active {
  border-color: var(--warn);
  background: var(--warn);
  color: white;
}

.report-type-option.denied.active {
  border-color: var(--bad);
  background: var(--bad);
  color: white;
}

.report-type-option.simplified.active {
  border-color: #466fb1;
  background: #466fb1;
  color: white;
}

.report-month-field,
.report-month-field input {
  cursor: pointer;
}

.report-reference small {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.report-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.report-card h3 {
  margin: 0;
  font-size: 17px;
}

.pie-card {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
}

.annual-report-card {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
}

.annual-month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.annual-month-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.annual-month-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 2px solid var(--primary);
}

.annual-month-heading h4 {
  margin: 0;
  font-size: 15px;
}

.annual-month-heading strong {
  font-size: 13px;
  white-space: nowrap;
}

.annual-month-content {
  display: grid;
  grid-template-columns: 112px minmax(0, 280px);
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 10px;
}

.annual-mini-pie {
  position: relative;
  width: 106px;
  height: 106px;
  margin: auto;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(16, 42, 51, 0.13);
  isolation: isolate;
}

.annual-mini-pie::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 25%;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
}

.annual-mini-pie.is-empty {
  box-shadow: none;
}

.annual-mini-pie-center {
  position: absolute;
  z-index: 2;
  inset: 29%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.annual-mini-pie-center strong {
  font-size: 16px;
  line-height: 1;
}

.annual-mini-pie-center span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.annual-plan-list {
  min-width: 0;
}

.annual-plan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 2px;
  border-bottom: 1px solid var(--line);
}

.annual-plan-row:last-child {
  border-bottom: 0;
}

.annual-plan-row span {
  overflow-wrap: anywhere;
}

.annual-plan-name {
  display: flex;
  align-items: center;
  gap: 6px;
}

.annual-plan-name i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.annual-month-empty {
  padding: 14px 2px 6px;
  color: var(--muted);
  text-align: center;
}

.report-card-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.report-card-heading small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.report-card-heading > strong {
  font-size: 20px;
}

.pie-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(360px, 620px);
  justify-content: center;
  gap: 42px;
  align-items: center;
  padding: 22px 8px 8px;
}

.report-pie {
  position: relative;
  width: min(260px, 100%);
  aspect-ratio: 1;
  margin: auto;
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(16, 42, 51, 0.14), inset 0 0 0 1px rgba(15, 39, 51, 0.08);
  isolation: isolate;
}

.report-pie::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 25%;
  border: 1px solid rgba(15, 39, 51, 0.08);
  border-radius: 50%;
  background: white;
  box-shadow: 0 4px 18px rgba(16, 42, 51, 0.12);
}

.report-pie.is-empty::before {
  box-shadow: none;
}

.report-pie-center {
  position: absolute;
  z-index: 2;
  inset: 29%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-radius: 50%;
  text-align: center;
}

.report-pie-center strong {
  color: var(--text);
  font-size: 32px;
  line-height: 1;
}

.report-pie-center span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.report-pie-value {
  position: absolute;
  z-index: 3;
  min-width: 28px;
  padding: 5px 7px;
  border: 2px solid;
  border-radius: 999px;
  background: white;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px rgba(16, 42, 51, 0.2);
}

.report-plan-legend {
  display: grid;
  width: 100%;
  max-width: 620px;
  gap: 4px;
}

.report-plan-legend-item {
  display: grid;
  grid-template-columns: 14px minmax(120px, 1fr) auto 58px;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

.report-plan-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.report-plan-legend-item small {
  color: var(--muted);
  text-align: right;
}

.report-patients {
  padding-top: 4px;
}

.report-detail-toolbar {
  justify-content: space-between;
  margin-bottom: 12px;
}

.report-detail-toolbar h3 {
  margin: 0;
}

.report-detail-toolbar span {
  color: var(--muted);
  font-size: 13px;
}

.report-plan-group-row th {
  padding: 11px 12px;
  border-top: 2px solid white;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--plan-color);
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}

.report-plan-group-row .report-plan-color {
  display: inline-block;
  margin-right: 8px;
  vertical-align: -1px;
}

.report-plan-group-row small {
  margin-left: 10px;
  color: var(--muted);
  font-weight: 600;
}

.month-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(44px, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 180px;
}

.month-chart-heading {
  display: flex;
  align-items: center;
  gap: 9px;
}

.chart-year-button {
  display: grid;
  width: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  place-items: center;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-size: 20px;
  line-height: 1;
}

.chart-year-button:hover {
  border-color: var(--primary);
  background: #e7f1f4;
  color: var(--primary);
}

.month-bar {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 7px;
  width: 100%;
  height: 170px;
  min-height: 170px;
  padding: 5px 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.month-bar:hover {
  border-color: #c7d9df;
  background: #f3f8fa;
  color: var(--primary-dark);
  transform: translateY(-2px);
}

.month-bar.selected {
  border-color: var(--primary);
  background: rgba(23, 107, 135, 0.09);
  color: var(--primary-dark);
  box-shadow: inset 0 0 0 1px rgba(23, 107, 135, 0.1);
}

.month-bar:focus-visible {
  outline: 3px solid rgba(23, 107, 135, 0.22);
  outline-offset: 2px;
}

.month-column {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  min-height: 0;
}

.month-value {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.month-stack {
  display: flex;
  flex-direction: column;
  align-self: end;
  width: 100%;
  min-height: 6px;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}

.month-stack .status-segment {
  width: 100%;
  flex-basis: var(--segment-size);
}

.month-stack.empty-stack {
  background: #dfe8eb;
}

.empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #102a33;
  color: white;
  padding: 12px 14px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.2s ease;
  max-width: 320px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1250px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  .profile-menu {
    grid-column: 2;
    grid-row: 1;
  }

  .topbar-filters {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    width: min(100%, 620px);
  }
}

@media (max-width: 1050px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: sticky;
    z-index: 20;
    padding: 14px 18px;
    overflow-y: visible;
  }

  .brand {
    width: auto;
    max-width: calc(100% - 56px);
  }

  .brand-symbol {
    flex: 0 1 180px;
    width: 180px;
    height: 76px;
    padding: 5px 8px;
    border-radius: 10px;
  }

  .menu-toggle {
    display: grid;
    place-items: center;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #294952;
  }

  .nav[hidden],
  .sidebar.menu-collapsed .nav {
    display: none;
  }

  .metrics-grid,
  .dashboard-grid,
  .pie-layout,
  .two-column,
  .two-column.compact {
    grid-template-columns: 1fr;
  }

  .logo-settings {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1301px) and (max-width: 1900px) {
  .visits-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .visits-toolbar h2,
  .visits-toolbar .pagination {
    grid-column: 1 / -1;
    max-width: none;
  }

  .visits-toolbar .pagination {
    justify-self: end;
  }
}

@media (max-width: 1300px) {
  .two-column,
  .two-column.compact {
    grid-template-columns: 1fr;
  }

  .visits-toolbar {
    grid-template-columns: auto minmax(180px, 1fr) minmax(230px, auto) auto;
  }

  .visits-toolbar .pagination {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (max-width: 680px) {
  .shell {
    padding: 18px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: start;
  }

  .topbar-copy {
    text-align: left;
  }

  .topbar-filters {
    grid-template-columns: 1fr;
    justify-self: stretch;
    width: 100%;
  }

  .profile-menu {
    grid-column: 2;
    grid-row: 1;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .nav,
  .metrics-grid,
  .form-grid,
  .period-builder {
    grid-template-columns: 1fr;
  }

  .brand-copy small {
    display: none;
  }

  .table-controls,
  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination {
    margin-left: 0;
  }

  .visits-toolbar {
    grid-template-columns: 1fr;
  }

  .check-toolbar {
    grid-template-columns: 1fr;
  }

  .visits-toolbar h2 {
    max-width: none;
  }

  .visits-toolbar .pagination {
    justify-self: stretch;
  }

  .report-reference {
    align-items: stretch;
    flex-direction: column;
  }

  .report-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .report-heading {
    grid-template-columns: 1fr;
  }

  .report-heading > div:first-child,
  .report-heading .report-actions {
    grid-column: 1;
  }

  .report-heading .report-actions {
    justify-self: stretch;
  }

  .report-type-options {
    align-items: stretch;
    flex-direction: column;
  }

  .status-edit-fields {
    grid-template-columns: 1fr;
  }

  .edit-dialog {
    padding: 16px;
  }

  .duplicate-visit-details {
    grid-template-columns: 1fr;
  }

  .duplicate-dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .duplicate-dialog-actions button {
    width: 100%;
    min-width: 0;
  }

  .report-plan-legend-item {
    grid-template-columns: 14px minmax(100px, 1fr) auto;
  }

  .report-plan-legend-item small {
    grid-column: 2 / 4;
    text-align: left;
  }

  .annual-month-content {
    grid-template-columns: 96px minmax(0, 240px);
  }

  .annual-mini-pie {
    width: 90px;
    height: 90px;
  }

  .span-2 {
    grid-column: auto;
  }

  .month-chart {
    grid-template-columns: repeat(6, minmax(38px, 1fr));
  }
}

@media print {
  .sidebar,
  .profile-menu,
  .report-actions,
  .toast {
    display: none !important;
  }

  body {
    display: block;
    background: white;
  }

  .shell {
    padding: 0;
  }

  .view {
    display: none !important;
  }

  #relatorios.view {
    display: block !important;
  }

  .panel,
  .report-card {
    box-shadow: none;
  }
}
