:root {
  color-scheme: light;
  --bg: #eef3f8;
  --text: #172033;
  --muted: #607086;
  --line: #d8e2ec;
  --panel: #ffffff;
  --primary: #4057ff;
  --primary-dark: #2738c8;
  --accent: #0f9b8e;
  --soft: #eef2ff;
  --success: #0f9b5f;
  --warning: #c77800;
  --danger: #b42318;
  --shadow: 0 16px 42px rgba(20, 35, 60, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    linear-gradient(180deg, #f8fbff 0, var(--bg) 260px),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

body.mobile-bottom-tabs {
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}

[hidden] {
  display: none !important;
}

.landing-screen {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 12%, rgba(64, 87, 255, 0.13), transparent 28%),
    linear-gradient(180deg, #ffffff 0, #eef3f8 72%);
  padding: 18px clamp(16px, 4vw, 56px) 44px;
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto 18px;
}

.landing-logo {
  width: 190px;
  height: auto;
}

.landing-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 28px;
  align-items: center;
  min-height: 430px;
}

.landing-copy h1 {
  max-width: 680px;
  font-size: 44px;
  line-height: 1.04;
  color: var(--text);
}

.landing-copy p {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.landing-demo-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  background: #fff;
  color: var(--primary-dark);
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}

.landing-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.landing-panel div {
  padding: 16px;
  border-radius: 12px;
  background: #f7faff;
  border: 1px solid #e0e7ff;
}

.landing-panel span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.landing-panel strong {
  display: block;
  margin-top: 4px;
  color: var(--primary-dark);
  font-size: 24px;
}

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

.landing-benefits article {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.landing-benefits strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}

.landing-benefits p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.landing-benefits b {
  color: var(--primary-dark);
}

.landing-close {
  margin: 22px auto 0;
  max-width: 760px;
  text-align: center;
  color: var(--primary-dark);
  font-weight: 800;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background:
    linear-gradient(135deg, rgba(64, 87, 255, 0.09), rgba(15, 155, 142, 0.11)),
    var(--bg);
}

.login-card {
  position: relative;
  width: min(100%, 420px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 22px 70px rgba(20, 35, 60, 0.16);
  padding: 28px;
}

.login-back-button {
  position: absolute;
  top: 14px;
  left: 14px;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 12px;
}

.login-back-button:hover {
  background: #eef2ff;
  color: var(--primary-dark);
  box-shadow: none;
}

.login-logo {
  display: block;
  width: 240px;
  height: auto;
  margin: 0 auto 18px;
}

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

.login-form h1 {
  font-size: 24px;
  text-align: center;
  margin-bottom: 2px;
}

.auth-status {
  min-height: 18px;
  color: #b42318;
  font-size: 13px;
  text-align: center;
}

.create-account {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.create-account summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 700;
  text-align: center;
}

.auth-link-button {
  width: 100%;
  box-shadow: none;
}

.compact-auth {
  margin-top: 14px;
}

.terms-check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.terms-check input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
}

.legal-links {
  display: grid;
  gap: 6px;
  text-align: center;
  font-size: 13px;
}

.legal-links a {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.legal-links a:hover {
  text-decoration: underline;
}

.reset-confirm-form {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.reset-code-box {
  display: block;
  padding: 10px 12px;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
  text-align: center;
}

.topbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 14px clamp(14px, 3vw, 36px) 8px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  flex-direction: column;
  position: relative;
  z-index: 50;
  box-shadow: 0 12px 32px rgba(20, 35, 60, 0.1);
}

.account-box {
  position: absolute;
  top: 10px;
  right: clamp(14px, 3vw, 32px);
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
}

.user-first-name {
  position: absolute;
  top: 10px;
  left: clamp(14px, 3vw, 32px);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.brand-logo {
  width: 218px;
  height: auto;
  object-fit: contain;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 36px);
}

h2 {
  font-size: 18px;
}

main {
  padding: 16px clamp(16px, 4vw, 48px) 56px;
  max-width: 1240px;
  margin: 0 auto;
}

.tabs {
  display: flex;
  width: min(100%, 1280px);
  max-width: calc(100vw - 32px);
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  min-width: 0;
  overflow: visible;
  padding: 1px 2px 6px;
  scroll-padding-inline: 2px;
  scroll-snap-type: none;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.admin-medico-picker {
  width: min(100%, 520px);
}

.admin-medico-picker label {
  grid-template-columns: auto minmax(220px, 1fr);
  align-items: center;
  color: var(--primary-dark);
}

.admin-medico-picker select {
  min-height: 40px;
  border-radius: 10px;
}

.account-menu-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: #eef3ff;
  border: 1px solid #dbe6ff;
  box-shadow: 0 8px 18px rgba(20, 35, 60, 0.08);
}

.account-menu-icon,
.account-menu-icon::before,
.account-menu-icon::after {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--primary);
  display: block;
}

.account-menu-icon {
  position: relative;
}

.account-menu-icon::before,
.account-menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.account-menu-icon::before {
  top: -7px;
}

.account-menu-icon::after {
  top: 7px;
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 142px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(20, 35, 60, 0.18);
  z-index: 80;
}

.account-menu button {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--primary-dark);
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.account-menu button:hover {
  background: #f1f5ff;
}

.tab,
button {
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  min-height: 44px;
  padding: 11px 16px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(64, 87, 255, 0.2);
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

button:hover {
  box-shadow: 0 12px 26px rgba(64, 87, 255, 0.26);
}

button:active {
  transform: translateY(1px);
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 6px;
  background: #f5f7ff;
  color: #26324a;
  border: 1px solid #dfe5ff;
  box-shadow: none;
  min-height: 44px;
  padding: 10px 12px;
  max-width: none;
  white-space: nowrap;
  scroll-snap-align: start;
}

.tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(64, 87, 255, 0.12);
  color: currentColor;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 10px 22px rgba(64, 87, 255, 0.22);
}

.tab.active .tab-icon {
  background: rgba(255, 255, 255, 0.22);
}

button.secondary {
  background: #eaf0f7;
  color: var(--text);
  box-shadow: none;
}

button.secondary:hover {
  background: #dfe7f0;
  box-shadow: none;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.medico-screen {
  max-width: 820px;
  margin: 0 auto;
}

.medico-form {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 22px;
}

.medico-form .section-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
  margin-bottom: 14px;
}

.medico-form .section-title h2 {
  margin: 0;
}

.medico-form #formStatus {
  grid-column: 1 / -1;
}

.medico-form,
.edit-procedure-form {
  font-size: 13px;
}

.medico-form .grid,
.edit-procedure-form .grid {
  gap: 10px;
}

.medico-form label,
.edit-procedure-form label {
  gap: 5px;
  font-size: 13px;
}

.medico-form input,
.medico-form select,
.medico-form textarea,
.edit-procedure-form input,
.edit-procedure-form select,
.edit-procedure-form textarea {
  min-height: 40px;
  border-radius: 10px;
  padding: 9px 12px;
}

.medico-form textarea,
.edit-procedure-form textarea {
  min-height: 76px;
}

.medico-form .procedure-picker,
.edit-procedure-form .procedure-picker {
  min-height: 42px;
  border-radius: 10px;
  padding: 5px 36px 5px 9px;
}

.medico-form .procedure-picker input,
.edit-procedure-form .procedure-picker input {
  min-height: 30px;
  padding: 4px;
}

.medico-form .procedure-box {
  margin-bottom: 12px;
}

.medico-form .observacao-field small {
  display: block;
  margin-top: -2px;
  line-height: 1.2;
}

.context-fields {
  margin-bottom: 12px;
}

.mobile-form-group-title {
  display: none;
}

.compact {
  margin-bottom: 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.report-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.small-title-button {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.one {
  grid-template-columns: 1fr;
  gap: 4px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.hospitals-plans-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inline-cadastro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.inline-cadastro button {
  min-height: 48px;
  white-space: nowrap;
}

.billing-admin-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(140px, 0.7fr) minmax(150px, 0.7fr) minmax(140px, auto) minmax(180px, auto);
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.billing-admin-form .actions {
  grid-column: 1 / -1;
  margin: 0;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: var(--muted);
  font-weight: 800;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
  min-height: auto;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.report-insights-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 12px;
  margin: 0 0 14px;
}

.report-insight-card {
  border: 1px solid #dbe6f2;
  border-radius: 14px;
  background: #ffffff;
  padding: 14px;
  box-shadow: 0 8px 20px rgba(20, 31, 55, 0.04);
}

.report-insight-card.wide {
  grid-column: 1 / -1;
}

.report-status-chart {
  display: grid;
  gap: 10px;
}

.chart-bar {
  display: flex;
  width: 100%;
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.chart-bar span {
  display: block;
  min-width: 2px;
}

.chart-success {
  background: var(--success);
}

.chart-danger {
  background: #dc2626;
}

.chart-legend {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.chart-success-dot {
  background: var(--success);
}

.chart-danger-dot {
  background: #dc2626;
}

.report-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

.admin-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 18px;
  margin-bottom: 20px;
}

.admin-upload-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr);
  justify-content: stretch;
  justify-items: stretch;
  margin-bottom: 20px;
}

.admin-combined-block {
  margin-top: 18px;
}

.csv-panel {
  width: 100%;
  border: 1px solid #dbe6f2;
  border-radius: 14px;
  padding: 18px;
  background: linear-gradient(180deg, #fbfdff, #f4f8fc);
  display: grid;
  gap: 14px;
  align-content: start;
}

.csv-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.csv-title-row h2 {
  margin: 0;
}

.csv-title-row button {
  min-height: 36px;
  padding: 7px 12px;
  white-space: nowrap;
}

.admin-report-filters {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.edit-filters {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-status-select {
  min-height: 36px;
  border-radius: 8px;
  padding: 6px 8px;
  min-width: 180px;
}

.csv-preview-box {
  margin-bottom: 20px;
}

.csv-output {
  width: 100%;
  min-height: 220px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  white-space: pre;
}

.csv-edit-input {
  width: 100%;
  min-width: 130px;
  min-height: 30px;
  border: 0;
  border-radius: 0;
  padding: 5px 6px;
  color: var(--text);
  background: transparent;
  font: inherit;
  line-height: 1.25;
  resize: none;
  overflow: hidden;
}

.csv-edit-input:focus {
  outline: none;
  background: #ffffff;
  box-shadow: inset 0 0 0 2px rgba(64, 87, 255, 0.28);
}

.converted-csv-details .table-wrap,
#adminCsvPreviewBox .table-wrap {
  border-radius: 4px;
}

.converted-csv-details .report-table,
#adminCsvPreviewBox .report-table {
  border-collapse: collapse;
  border-spacing: 0;
  min-width: 980px;
}

.converted-csv-details .report-table th,
.converted-csv-details .report-table td,
#adminCsvPreviewBox .report-table th,
#adminCsvPreviewBox .report-table td {
  border: 1px solid #cfd8e6;
  padding: 0;
  vertical-align: top;
}

.converted-csv-details .report-table th,
#adminCsvPreviewBox .report-table th {
  padding: 6px 7px;
  background: #eef3f8;
  font-size: 12px;
}

.converted-csv-details .csv-action-cell,
.converted-csv-details .csv-validation-cell,
#adminCsvPreviewBox .csv-action-cell,
#adminCsvPreviewBox .csv-validation-cell {
  padding: 6px 7px;
  min-width: 170px;
  white-space: normal;
}

.compact-settings-form {
  display: grid;
  gap: 14px;
  max-width: 520px;
}

.upload-settings-panel {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.statement-analysis-note {
  margin: 10px 0 14px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #f5f8ff;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.csv-error-row td {
  background: #fff1f1;
  color: #9f1239;
  border-color: #fecdd3;
}

.filter-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  margin-bottom: 18px;
  box-shadow: 0 8px 22px rgba(20, 35, 60, 0.05);
}

.filter-panel summary {
  cursor: pointer;
  font-weight: 700;
  padding: 12px 14px;
}

.filter-panel .report-filters {
  padding: 0 14px 14px;
  margin-bottom: 0;
}

.filter-actions {
  display: flex;
  align-items: end;
}

.filter-actions button {
  width: 100%;
}

.report-card {
  border: 1px solid #dbe6f2;
  border-radius: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #ffffff, #f7faff);
  box-shadow: 0 8px 18px rgba(20, 35, 60, 0.06);
}

.report-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  margin-bottom: 4px;
}

.report-card strong {
  font-size: 20px;
  color: var(--primary-dark);
}

.success-card strong,
.total-card strong {
  color: var(--success);
}

.danger-card strong {
  color: var(--danger);
}

.combined-card strong {
  color: var(--primary);
}

label {
  display: grid;
  gap: 7px;
  color: #1f2937;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: #fbfdff;
  font: inherit;
  min-height: 48px;
  padding: 12px 14px;
  outline-color: var(--primary);
}

input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  text-align: left;
}

input[type="date"]::-webkit-date-and-time-value {
  display: block;
  min-height: 22px;
  text-align: left;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(64, 87, 255, 0.14);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #eef3f8;
  color: #7b8796;
  cursor: not-allowed;
  opacity: 1;
}

input::placeholder,
textarea::placeholder {
  color: #607086;
}

textarea {
  resize: vertical;
}

.password-field {
  position: relative;
  display: block;
  width: 100%;
}

.password-field input {
  width: 100%;
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #dbe4ff;
  background: #f5f7ff;
  color: var(--primary-dark);
  box-shadow: none;
  transform: translateY(-50%);
  line-height: 1;
}

.password-toggle::before {
  content: "";
  width: 17px;
  height: 17px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 5C6.5 5 2.2 9.5 1 12c1.2 2.5 5.5 7 11 7s9.8-4.5 11-7c-1.2-2.5-5.5-7-11-7Zm0 11a4 4 0 1 1 0-8 4 4 0 0 1 0 8Zm0-2.2a1.8 1.8 0 1 0 0-3.6 1.8 1.8 0 0 0 0 3.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 5C6.5 5 2.2 9.5 1 12c1.2 2.5 5.5 7 11 7s9.8-4.5 11-7c-1.2-2.5-5.5-7-11-7Zm0 11a4 4 0 1 1 0-8 4 4 0 0 1 0 8Zm0-2.2a1.8 1.8 0 1 0 0-3.6 1.8 1.8 0 0 0 0 3.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.password-toggle:hover {
  background: #eaf0ff;
  box-shadow: none;
}

.password-toggle.active {
  background: var(--primary);
  color: #fff;
}

.password-toggle:active {
  transform: translateY(-50%);
}

small {
  color: var(--muted);
  text-align: left;
  font-size: 12px;
}

.form-status-message {
  display: block;
  min-height: 20px;
  padding: 7px 10px;
  border-radius: 8px;
  background: transparent;
  font-weight: 700;
}

.form-status-message:empty {
  display: none;
}

.form-status-message.success {
  background: #ecfdf5;
  color: var(--success);
}

.form-status-message.error {
  background: #fff1f2;
  color: var(--danger);
}

.procedure-box {
  margin: 0 0 18px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
}

.procedure-picker {
  display: flex;
  align-items: center;
  min-height: 50px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  padding: 6px 40px 6px 10px;
  position: relative;
}

.procedure-picker input {
  min-width: 220px;
  flex: 1;
  border: 0;
  border-radius: 0;
  padding: 6px 4px;
}

.selected-procedures {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.procedure-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  background: #edf1ff;
  color: #1f2a60;
  border: 1px solid #d7ddff;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.2;
}

.procedure-chip button,
.clear-procedures {
  border: 0;
  background: transparent;
  color: #666;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.procedure-chip button {
  font-size: 16px;
}

.clear-procedures {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.results {
  display: grid;
  gap: 0;
  margin-top: 6px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(20, 35, 60, 0.08);
}

.results:empty {
  display: none;
}

.result-item {
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 12px 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
  font-weight: 400;
  line-height: 1.35;
}

.result-item:hover,
.result-item.selected {
  background: #e4edff;
  color: #000;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.form-actions-left {
  justify-content: flex-start;
  margin-top: 4px;
}

.form-actions-left button {
  background: var(--primary);
  border-radius: 12px;
  min-height: 48px;
  padding: 12px 18px;
  box-shadow: 0 10px 22px rgba(64, 87, 255, 0.22);
}

.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pagination-bar button {
  min-height: 34px;
  padding: 7px 12px;
}

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

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #fff;
}

.report-table {
  min-width: 1120px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #41516a;
  font-size: 12px;
  text-transform: uppercase;
  background: #f6f9fc;
}

.report-table th {
  color: #172033;
  font-size: 14px;
  text-transform: none;
  font-weight: 700;
  border-bottom: 2px solid #cfd9e6;
  background: #f2f6fb;
}

.report-hospital-row td {
  padding: 12px 10px;
  background: #dce8ff;
  border-top: 2px solid #b8c8ff;
  border-bottom: 1px solid #c8d6ff;
}

.report-hospital-row div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-hospital-row strong {
  color: #1f2a60;
  font-size: 15px;
}

.report-hospital-row span {
  color: #41516a;
  font-size: 13px;
  font-weight: 800;
}

.report-group-row td {
  padding: 10px;
  background: #eef2ff;
  border-top: 2px solid #cfd9e6;
  border-bottom: 1px solid #d8e1ff;
}

.report-group-row div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-group-row strong {
  color: #41516a;
  font-size: 13px;
}

.report-subtotal-row td {
  background: #f8fbff;
  font-weight: 800;
  border-top: 1px solid #dbe6f2;
}

.report-subtotal-row td:first-child {
  text-align: right;
  color: #41516a;
}

.report-subtotal-row td:last-child {
  color: var(--primary);
}

.report-table tfoot td {
  font-weight: 700;
  border-top: 2px solid #cfd9e6;
  background: #f8fbff;
}

.report-table tfoot td:first-child {
  text-align: right;
}

.report-table tfoot td:last-child {
  color: var(--success);
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  background: #fff7e6;
  color: #935a00;
  font-weight: 700;
  font-size: 12px;
}

.simple-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.simple-list li {
  background: #f6f9ff;
  border: 1px solid #dfe7ff;
  border-radius: 10px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.list-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.icon-action {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
}

.icon-action.danger {
  color: #b42318;
}

#formStatus {
  color: var(--primary);
  font-weight: 700;
}

#editarProcedimentoStatus {
  color: var(--primary);
  font-weight: 700;
}

.floating-notice {
  position: fixed;
  left: 50%;
  top: 18px;
  z-index: 200;
  width: min(420px, calc(100vw - 28px));
  padding: 12px 14px;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background: #fff7ed;
  color: #7c2d12;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  display: grid;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.floating-notice.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.floating-notice.info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
}

.floating-notice strong {
  font-size: 14px;
}

.floating-notice span {
  font-size: 13px;
  line-height: 1.35;
}

.edit-procedure-form {
  display: grid;
  gap: 10px;
  margin-top: 0;
}

.edit-results {
  margin-bottom: 10px;
}

.modal-open {
  overflow: hidden;
}

.pdf-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(15, 23, 42, 0.54);
}

.pdf-preview-panel {
  width: min(1120px, 100%);
  max-height: min(92vh, 920px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-strong);
}

.pdf-preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #d7e2f2;
  background: #f8fbff;
}

.pdf-preview-actions > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pdf-preview-actions button {
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 13px;
}

.pdf-preview-report {
  overflow: auto;
  padding: 24px;
  color: #111;
}

.pdf-preview-report h1 {
  margin: 0 0 18px;
  font-size: 20px;
}

.pdf-preview-report table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.pdf-preview-report th,
.pdf-preview-report td {
  border: 1px solid #bbb;
  padding: 7px;
  text-align: left;
  vertical-align: top;
}

.pdf-preview-report th {
  background: #f0f0f0;
}

.pdf-preview-report .hospital td {
  background: #dce8ff;
  color: #1f2a60;
  font-weight: 700;
}

.pdf-preview-report .group td {
  background: #eef2ff;
  color: #1f2a60;
  font-weight: 700;
}

.pdf-preview-report .subtotal td {
  background: #f8fbff;
  font-weight: 700;
}

.pdf-preview-report tfoot td {
  border-top: 3px solid #222;
  font-weight: 700;
}

.pdf-preview-report tfoot td:first-child {
  text-align: right;
}

.pdf-preview-report tfoot td:last-child {
  color: #00a651;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.48);
}

.modal-panel {
  width: min(980px, 100%);
  max-height: min(88vh, 860px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  padding: 20px;
}

.confirm-modal {
  width: min(320px, 100%);
  max-height: none;
  align-self: center;
  justify-self: center;
  padding: 16px;
  overflow: visible;
}

.confirm-modal p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.confirm-modal .modal-header {
  margin-bottom: 10px;
}

.confirm-modal h2 {
  font-size: 18px;
}

.support-modal {
  width: min(560px, 100%);
  max-height: min(86vh, 760px);
  align-self: center;
  justify-self: center;
  padding: 16px;
  overflow: auto;
}

.support-modal-content {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

.support-modal-content p {
  margin: 0;
}

.support-help-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dbe6f2;
  border-radius: 12px;
  background: #f8fbff;
}

.support-help-box h3,
.support-guide h3,
.install-platform h4 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 15px;
}

.support-email-form {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.support-email-form input,
.support-email-form textarea {
  min-height: 40px;
  border-radius: 10px;
  padding: 9px 11px;
}

.support-email-form button {
  justify-self: start;
  min-height: 40px;
  padding: 9px 14px;
}

.support-guide {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.support-guide ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.support-guide li {
  padding-left: 2px;
  line-height: 1.35;
}

.support-guide strong {
  color: var(--text);
}

.support-modal-content a {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.support-modal-content a:hover {
  text-decoration: underline;
}

.install-guide {
  display: grid;
  gap: 10px;
}

.install-platform ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.install-platform li {
  line-height: 1.35;
}

.install-platform p {
  margin: 2px 0 0;
}

.billing-modal {
  width: min(620px, calc(100vw - 32px));
  max-height: min(90vh, 820px);
  align-self: center;
  justify-self: center;
  padding: 16px;
}

.billing-subscription {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.billing-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  border: 1px solid #dbe6f2;
  border-radius: 14px;
  background: #f8fbff;
  padding: 12px;
}

.billing-summary h3 {
  margin: 4px 0 8px;
  font-size: 19px;
}

.billing-summary p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.billing-plan-select {
  display: grid;
  gap: 6px;
  margin: 8px 0 10px;
}

.billing-plan-select select {
  min-height: 40px;
  border-radius: 10px;
}

.billing-summary ul {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
}

.billing-summary li::before {
  content: "✓";
  margin-right: 8px;
  color: var(--success);
  font-weight: 900;
}

.billing-summary li.benefit-unavailable {
  color: #b42318;
}

.billing-summary li.benefit-unavailable::before {
  content: "×";
  color: #dc2626;
}

.billing-eyebrow {
  display: block;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.billing-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 8px 0 0;
}

.billing-price strong {
  color: var(--text);
  font-size: 24px;
  letter-spacing: 0;
}

.billing-price span {
  color: var(--muted);
  font-weight: 700;
}

.invoice-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin: 5px 0 0;
  padding: 5px 10px;
  border-radius: 999px;
  color: #8a5a00;
  background: #fff4d6;
  font-size: 12px;
  font-weight: 900;
}

.billing-invoice {
  display: grid;
  grid-template-columns: minmax(170px, 0.9fr) minmax(280px, 1.6fr);
  align-items: start;
  gap: 14px;
  border: 1px solid #dbe6f2;
  border-radius: 14px;
  background: #ffffff;
  padding: 12px;
}

.billing-invoice dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
}

.billing-invoice dl div {
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 10px;
  background: #f8fbff;
}

.billing-invoice dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.billing-invoice dd {
  margin: 0;
  text-align: left;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.billing-rules {
  display: grid;
  gap: 8px;
  border: 1px solid #dbe6f2;
  border-radius: 14px;
  background: #ffffff;
  padding: 12px;
}

.billing-rules ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.billing-form {
  display: grid;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.compact-title {
  align-items: end;
  margin-bottom: 0;
}

.compact-title h3 {
  margin: 0;
  font-size: 17px;
}

.compact-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.billing-form-row {
  display: grid;
  grid-template-columns: 1fr 0.7fr;
  gap: 10px;
}

.billing-form input {
  min-height: 40px;
  border-radius: 10px;
}

.billing-security {
  color: var(--muted);
  line-height: 1.35;
}

.auth-modal {
  width: min(460px, 100%);
  max-height: none;
  align-self: center;
  justify-self: center;
  overflow: visible;
}

.confirm-modal .form-actions-left {
  position: static;
  margin: 0;
}

.confirm-modal .form-actions-left button {
  width: auto;
  min-width: 92px;
  min-height: 42px;
  padding: 9px 18px;
}

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

.modal-close {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.modal-actions {
  gap: 10px;
  flex-wrap: wrap;
}

.modal-actions button.secondary {
  background: #eaf0f7;
  color: var(--text);
  box-shadow: none;
}

.attendance-table {
  min-width: 1180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.attendance-table th {
  background: #f8fafc;
  color: #40516d;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
}

.attendance-table td {
  font-size: 13px;
  color: #0f172a;
}

.attendance-table td strong {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}

.attendance-table td small {
  display: block;
  color: #40516d;
  font-size: 12px;
}

.procedure-line {
  margin-bottom: 4px;
  line-height: 1.35;
}

.status-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.pending {
  background: #fff3d8;
  color: #935a00;
  border: 1px solid #ffd99b;
}

.status-pill.paid {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.status-pill.canceled {
  background: #eef2f7;
  color: #374151;
  border: 1px solid #d8e2ec;
}

.money-cell {
  color: var(--success);
  white-space: nowrap;
  font-weight: 700;
}

.voice-title-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-left: auto;
  align-self: center;
}

.voice-title-control small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  max-width: 82px;
  text-align: right;
}

.voice-record-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  color: var(--primary);
  border: 1px solid #b8c6ff;
  background: #eef2ff;
  box-shadow: 0 8px 18px rgba(64, 87, 255, 0.16);
}

.voice-record-button.recording {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 6px rgba(64, 87, 255, 0.12);
}

.voice-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.voice-record-button.recording .voice-icon {
  transform: scale(0.92);
}

.voice-record-button .voice-icon {
  display: block;
  fill: none !important;
  stroke: currentColor !important;
}

.voice-cancel-button {
  min-height: 32px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 0.78rem;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #dbe3ee;
  box-shadow: none;
}

.audio-processing-notice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin-top: -4px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--primary);
  background: #eef2ff;
  border: 1px solid #d8e1ff;
  font-size: 0.78rem;
  font-weight: 700;
}

.audio-processing-notice[hidden] {
  display: none;
}

.audio-processing-notice span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--primary);
  animation: audioProcessingPulse 1s ease-in-out infinite;
}

@keyframes audioProcessingPulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@media print {
  body.pdf-preview-open > :not(.pdf-preview-backdrop) {
    display: none !important;
  }

  body.pdf-preview-open {
    background: #ffffff !important;
  }

  body.pdf-preview-open .pdf-preview-backdrop {
    position: static;
    display: block;
    padding: 0;
    background: #ffffff;
  }

  body.pdf-preview-open .pdf-preview-panel {
    display: block;
    width: 100%;
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.pdf-preview-open .pdf-preview-actions {
    display: none !important;
  }

  body.pdf-preview-open .pdf-preview-report {
    overflow: visible;
    padding: 0;
  }
}

.edit-row-button {
  background: #fff;
  color: #007bff;
  border: 1px solid #9db6ff;
  border-radius: 8px;
  padding: 7px 10px;
  font-weight: 700;
  box-shadow: none;
}

.edit-row-button.danger {
  color: #b42318;
  border-color: #fda4af;
  background: #fff1f2;
}

.edit-row-button:disabled {
  color: #94a3b8;
  border-color: #e2e8f0;
  background: #f8fafc;
  cursor: not-allowed;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-user-plan {
  width: 180px;
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 8px;
}

@media (max-width: 860px) {
  .landing-screen {
    padding: 12px 14px 28px;
  }

  .landing-header {
    margin-bottom: 8px;
  }

  .landing-logo {
    width: 148px;
  }

  .landing-hero {
    grid-template-columns: 1fr;
    gap: 16px;
    min-height: auto;
    padding-top: 10px;
  }

  .landing-copy h1 {
    font-size: 32px;
  }

  .landing-copy p {
    font-size: 15px;
  }

  .landing-actions {
    gap: 8px;
    margin-top: 18px;
  }

  .landing-actions button,
  .landing-demo-button {
    flex: 1;
    min-width: 0;
  }

  .landing-panel {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .landing-panel strong {
    font-size: 20px;
  }

  .landing-benefits {
    grid-template-columns: 1fr;
    margin-top: 16px;
  }

  .voice-title-control {
    gap: 6px;
  }

  .voice-title-control small {
    max-width: 62px;
    font-size: 0.66rem;
  }

  .topbar {
    align-items: center;
    padding: 8px 10px 5px;
    gap: 4px;
    position: relative;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 8px 20px rgba(20, 35, 60, 0.08);
  }

  .brand {
    align-items: center;
    justify-content: center;
    margin-top: 0;
  }

  .brand-logo {
    width: 142px;
    height: auto;
  }

  .account-box {
    top: 11px;
    right: 14px;
  }

  .user-first-name {
    top: 6px;
    left: 14px;
    max-width: 84px;
    font-size: 10px;
  }

  .login-card {
    padding: 20px;
    border-radius: 14px;
  }

  .login-back-button {
    top: 10px;
    left: 10px;
  }

  .login-logo {
    width: 210px;
  }

  main {
    padding: 8px 12px calc(144px + env(safe-area-inset-bottom));
    width: 100%;
  }

  h2 {
    font-size: 17px;
  }

  .medico-form .section-title {
    margin-bottom: 10px;
  }

  .medico-form .grid,
  .edit-procedure-form .grid {
    gap: 8px;
  }

  .medico-form label {
    gap: 4px;
    font-size: 12px;
  }

  .mobile-form-group-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 12px 0 8px;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0;
  }

  .mobile-form-group-title:first-of-type {
    margin-top: 2px;
  }

  .mobile-form-group-title::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--primary);
  }

  .medico-form input,
  .medico-form select {
    min-height: 37px;
    border-radius: 9px;
    padding: 7px 10px;
    font-size: 15px;
  }

  .medico-form .procedure-picker {
    min-height: 38px;
    border-radius: 9px;
    padding: 6px 34px 6px 9px;
  }

  .medico-form .procedure-picker input {
    min-height: 28px;
    padding: 2px;
  }

  .context-fields,
  .medico-form .procedure-box {
    margin-bottom: 8px;
  }

  .panel,
  .medico-form {
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 14px;
  }

  .modal-backdrop {
    padding: 8px;
    align-items: stretch;
    overflow-x: hidden;
  }

  .modal-panel {
    max-height: calc(100vh - 16px);
    border-radius: 14px;
    padding: 14px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .modal-backdrop:has(.confirm-modal) {
    align-items: center;
  }

  .modal-backdrop:has(.auth-modal) {
    align-items: center;
  }

  .confirm-modal {
    width: min(300px, calc(100vw - 32px));
    max-height: none;
    padding: 14px;
  }

  .auth-modal {
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
  }

  .billing-modal {
    width: min(100%, calc(100vw - 18px));
    max-width: calc(100vw - 18px);
    max-height: calc(100dvh - 18px);
    padding: 12px;
    overflow-x: hidden;
  }

  .billing-modal *,
  .billing-subscription,
  .billing-summary,
  .billing-invoice,
  .billing-form {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .billing-subscription {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .billing-summary {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .billing-summary ul {
    grid-template-columns: 1fr;
  }

  .billing-price strong {
    font-size: 22px;
  }

  .billing-invoice {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .billing-invoice dl {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .billing-form-row {
    grid-template-columns: 1fr;
  }

  .billing-plan-select select,
  .billing-form input {
    width: 100%;
    max-width: 100%;
  }

  .support-email-form button {
    width: 100%;
  }

  .confirm-modal .form-actions-left {
    position: static;
    margin: 0;
  }

  .confirm-modal .form-actions-left button {
    width: auto;
    min-height: 42px;
    font-size: 14px;
  }

  .modal-actions {
    position: static;
    margin: 10px 0 0;
  }

  .modal-actions button {
    width: auto;
    flex: 1 1 120px;
    min-width: 0;
    min-height: 44px;
    font-size: 14px;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .title-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
  }

  .small-title-button {
    flex: 0 1 auto;
    min-height: 32px;
  }

  .csv-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .csv-title-row button {
    width: 100%;
    white-space: normal;
  }

  .grid.two,
  .admin-grid,
  .admin-control-grid,
  .admin-upload-grid,
  .billing-admin-form,
  .report-filters {
    grid-template-columns: 1fr;
  }

  .billing-admin-form {
    padding: 12px;
  }

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

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

  .report-card {
    padding: 9px 10px;
  }

  .report-card strong {
    font-size: 18px;
  }

  .admin-report-filters,
  .edit-filters,
  .admin-summary-grid {
    grid-template-columns: 1fr;
  }

  .tabs,
  .actions {
    width: 100%;
  }

  .account-menu-button {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
  }

  .account-menu {
    min-width: 132px;
  }

  .tabs {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px;
    position: fixed;
    left: 0 !important;
    right: auto !important;
    bottom: calc(var(--mobile-viewport-bottom, 0px) + 8px);
    z-index: 1000;
    width: 100dvw;
    max-width: 100dvw;
    min-height: calc(74px + env(safe-area-inset-bottom));
    padding: 8px 10px calc(12px + env(safe-area-inset-bottom));
    scroll-padding-inline: 10px;
    border: 0;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -12px 28px rgba(20, 35, 60, 0.12);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow-x: auto;
    overflow-y: visible;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }

  .tabs.mobile-bottom-nav {
    position: fixed !important;
    left: 0 !important;
    right: auto !important;
    top: auto !important;
    bottom: calc(var(--mobile-viewport-bottom, 0px) + 8px) !important;
    width: 100dvw !important;
    max-width: 100dvw !important;
    z-index: 1000 !important;
  }

  body.modal-open .tabs.mobile-bottom-nav {
    display: none;
  }

  .admin-medico-picker,
  .admin-medico-picker label {
    width: 100%;
  }

  .admin-medico-picker label {
    grid-template-columns: 1fr;
    gap: 4px;
    font-size: 12px;
  }

  .admin-medico-picker select {
    min-height: 38px;
    padding: 8px 10px;
  }

  .tab {
    width: 82px;
    min-width: 82px;
    flex: 0 0 82px;
    min-height: 54px;
    padding: 4px 6px 5px;
    border-radius: 14px;
    font-size: 10px;
    line-height: 1.1;
    max-width: none;
    white-space: nowrap;
    scroll-snap-align: start;
    flex-direction: column;
    gap: 3px;
    color: var(--primary-dark);
    background: #f6f8ff;
    border-color: #dfe5ff;
  }

  .tab span:not(.tab-icon) {
    display: none;
  }

  .tab::after {
    content: attr(data-mobile-label);
    display: block;
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
    color: inherit;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.1;
    white-space: normal;
    text-align: center;
  }

  .tab-icon {
    min-width: 26px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    color: var(--primary);
    background: #eaf0ff;
    font-size: 14px;
  }

  .tab.active {
    color: #fff;
  }

  .actions button {
    flex: 1;
  }

  input,
  select,
  textarea,
  .procedure-picker {
    font-size: 16px;
  }

  .medico-form input,
  .medico-form select,
  .medico-form .procedure-picker {
    font-size: 15px;
  }

  .procedure-picker {
    align-items: stretch;
    flex-direction: column;
    padding: 8px 40px 8px 10px;
  }

  .medico-form .procedure-picker {
    padding: 6px 34px 6px 9px;
  }

  .procedure-picker input {
    min-width: 0;
    width: 100%;
  }

  .procedure-chip {
    width: 100%;
    justify-content: space-between;
  }

  #lancamentoForm .form-actions-left {
    position: static;
    z-index: 20;
    margin-left: -4px;
    margin-right: -4px;
  }

  #lancamentoForm .form-actions-left > button {
    width: 100%;
    min-height: 54px;
    font-size: 16px;
  }

  .lancamento-actions {
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .lancamento-actions > button[type="submit"] {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  .voice-title-control-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
  }

  .voice-title-control-footer small {
    display: none;
  }

  .voice-title-control-footer .voice-record-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 999px;
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
  }

  .voice-title-control-footer .voice-icon {
    width: 19px;
    height: 19px;
    color: #ffffff;
    stroke-width: 2.3;
  }

  .voice-title-control-footer .voice-cancel-button {
    position: static;
    width: auto;
    min-height: 30px;
    font-size: 11px;
  }

  .csv-panel {
    padding: 14px;
    gap: 12px;
  }

  .converted-csv-details .section-title {
    gap: 10px;
  }

  .converted-csv-details .section-title button {
    width: 100%;
  }

  #uploadArquivoCsvTabelaHead {
    display: none;
  }

  #uploadArquivoCsvTabelaBody {
    display: grid;
    gap: 10px;
  }

  #uploadArquivoCsvTabelaBody tr {
    display: grid;
    gap: 9px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    box-shadow: 0 10px 24px rgba(20, 35, 60, 0.08);
  }

  #uploadArquivoCsvTabelaBody td {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    border-bottom: 0;
    padding: 0;
    overflow-wrap: anywhere;
  }

  #uploadArquivoCsvTabelaBody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
  }

  #uploadArquivoCsvTabelaBody .csv-action-cell,
  #uploadArquivoCsvTabelaBody .csv-validation-cell {
    font-size: 13px;
    line-height: 1.35;
  }

  .csv-edit-input {
    min-width: 0;
    min-height: 40px;
    font-size: 16px;
  }

  .table-wrap {
    margin-left: -4px;
    margin-right: -4px;
  }

  .pagination-bar {
    display: grid;
    grid-template-columns: minmax(82px, auto) 1fr minmax(82px, auto);
    align-items: center;
    gap: 8px;
    text-align: center;
  }

  .pagination-bar span {
    font-size: 13px;
    line-height: 1.25;
  }

  .pagination-bar button {
    min-width: 0;
    padding: 8px 10px;
  }

  #lancamentosMedico,
  #editarLancamentosLista,
  #lancamentosRelatorios,
  #adminLancamentosLista,
  #adminUsuariosLista {
    display: grid;
    gap: 10px;
  }

  #lancamentosMedico tr,
  #editarLancamentosLista tr,
  #lancamentosRelatorios tr,
  #adminLancamentosLista tr,
  #adminUsuariosLista tr {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    box-shadow: 0 10px 24px rgba(20, 35, 60, 0.08);
  }

  #lancamentosMedico td,
  #editarLancamentosLista td,
  #lancamentosRelatorios td,
  #adminLancamentosLista td,
  #adminUsuariosLista td {
    display: grid;
    grid-template-columns: minmax(90px, 36%) minmax(0, 1fr);
    gap: 8px;
    border-bottom: 0;
    padding: 0;
    overflow-wrap: anywhere;
    font-size: 13px;
  }

  #lancamentosMedico td::before,
  #editarLancamentosLista td::before,
  #lancamentosRelatorios td::before,
  #adminLancamentosLista td::before,
  #adminUsuariosLista td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
  }

  #lancamentosRelatorios .report-hospital-row td,
  #lancamentosRelatorios .report-group-row td,
  #lancamentosRelatorios .report-subtotal-row td {
    display: block;
  }

  #lancamentosRelatorios .report-hospital-row td::before,
  #lancamentosRelatorios .report-group-row td::before,
  #lancamentosRelatorios .report-subtotal-row td::before {
    content: "";
    display: none;
  }

  #lancamentosRelatorios .report-hospital-row div,
  #lancamentosRelatorios .report-group-row div {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  #lancamentosRelatorios .report-subtotal-row td:first-child {
    text-align: left;
  }

  #lancamentosMedico:empty,
  #editarLancamentosLista:empty,
  #lancamentosRelatorios:empty,
  #adminLancamentosLista:empty,
  #adminUsuariosLista:empty {
    display: table-row-group;
  }

  .table-wrap table:has(#lancamentosMedico),
  .table-wrap table:has(#editarLancamentosLista),
  .table-wrap table:has(#lancamentosRelatorios),
  .table-wrap table:has(#adminLancamentosLista),
  .table-wrap table:has(#adminUsuariosLista),
  .attendance-table,
  .report-table {
    min-width: 0;
  }

  .table-wrap table:has(#lancamentosMedico) thead,
  .table-wrap table:has(#editarLancamentosLista) thead,
  .table-wrap table:has(#lancamentosRelatorios) thead,
  .table-wrap table:has(#adminLancamentosLista) thead,
  .table-wrap table:has(#adminUsuariosLista) thead,
  .report-table tfoot {
    display: none;
  }

  th,
  td {
    padding: 10px 8px;
    font-size: 13px;
  }

  .simple-list li {
    align-items: stretch;
    flex-direction: column;
  }

  .list-actions {
    width: 100%;
  }

  .icon-action,
  .edit-row-button {
    flex: 1;
    min-height: 42px;
  }
}
