/**
 * Arquivo: public/style.css
 * Responsabilidade: Estilos estruturais e responsividade da interface.
 * Manutenção: consulte docs/ARQUIVOS.md e docs/DESENVOLVIMENTO.md.
 */
:root {
  font-family:
    Inter,
    Segoe UI,
    system-ui,
    sans-serif;
  color: #193346;
  background: #f3f6f9;
  font-size: 16px;
  --brand: #164e63;
  --muted: #647788;
  --line: #dfe7ee;
  --accent: #167c79;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 15px;
  color: var(--brand);
  background: white;
  font-weight: 600;
}
button:hover {
  background: #edf6f6;
  border-color: #97bdbd;
}
button.primary {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}
button.primary:hover {
  background: #0e3e51;
}
button.small {
  padding: 6px 10px;
  font-size: 14px;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #c9d6df;
  border-radius: 8px;
  background: white;
  color: #193346;
}
textarea {
  min-height: 115px;
  resize: vertical;
}
label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 7px;
}
label input,
label select,
label textarea {
  margin-top: 8px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 30px;
  letter-spacing: -0.8px;
}
h2 {
  font-size: 19px;
}
h3 {
  font-size: 16px;
}
.muted {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 1.7px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.shell {
  display: grid;
  grid-template-columns: 242px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.logo {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 31px;
  font-weight: 750;
  letter-spacing: -1px;
  color: var(--brand);
}
.logo img {
  height: 38px;
  width: 38px;
}
.logo small {
  display: block;
  font-size: 12px;
  letter-spacing: 0.5px;
  font-weight: 500;
  color: var(--muted);
}
nav {
  display: grid;
  gap: 7px;
}
nav button {
  text-align: left;
  background: transparent;
  border: 0;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
}
nav button.active {
  background: #e6f2f3;
  color: #145665;
  font-weight: 700;
}
.sidebar nav span {
  font-size: 19px;
  width: 24px;
  text-align: center;
}
.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.avatar {
  height: 38px;
  width: 38px;
  border-radius: 50%;
  background: #e2eff5;
  display: inline-grid;
  place-items: center;
  color: #164e63;
  font-weight: 700;
  flex-shrink: 0;
}
.person {
  display: flex;
  gap: 12px;
  align-items: center;
}
.person strong {
  font-size: 14px;
}
.main {
  min-width: 0;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  height: 77px;
  padding: 0 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.topbar strong {
  font-size: 14px;
}
.local {
  background: #f1f5f8;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: #536b7d;
}
.content {
  padding: 32px 38px;
  max-width: 1480px;
  margin: auto;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.heading p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 24px 0;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  padding: 22px;
  border-radius: 12px;
}
.stat .value {
  font-size: 29px;
  font-weight: 650;
  letter-spacing: -0.6px;
  margin: 12px 0 5px;
}
.stat .muted {
  font-size: 13px;
}
.stat-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}
.stat-label span {
  color: var(--accent);
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
  gap: 22px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 22px;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid #edf1f5;
}
.row:first-child {
  border: 0;
}
.row p {
  margin-top: 5px;
}
.time {
  font-size: 20px;
  font-weight: 650;
  min-width: 67px;
}
.time small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 5px;
}
.grow {
  flex: 1;
}
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 6px;
  background: #edf3f8;
  color: #536b7d;
  white-space: nowrap;
}
.badge.confirmada,
.badge.recebido,
.badge.pago,
.badge.concluída {
  background: #e6f5f0;
  color: #137956;
}
.badge.pendente,
.badge.agendada {
  background: #fff4dc;
  color: #936311;
}
.badge.cancelada,
.badge.falta {
  background: #fbeaec;
  color: #a94252;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.empty {
  padding: 26px;
  text-align: center;
  color: var(--muted);
  line-height: 1.7;
}
.notice {
  border-left: 3px solid #20a29d;
  background: #eff8f8;
  padding: 18px;
  border-radius: 4px;
  line-height: 1.7;
  font-size: 14px;
}
.notice strong {
  display: block;
  margin-bottom: 6px;
}
.welcome {
  background: var(--brand);
  color: white;
  padding: 28px;
  border-radius: 12px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.welcome p {
  color: #c7dde7;
  margin-top: 9px;
  font-size: 15px;
}
.welcome button {
  border: 0;
}
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.toolbar input,
.toolbar select {
  width: auto;
  min-width: 180px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  background: #f7f9fb;
}
td,
th {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td:first-child {
  font-weight: 600;
}
.patients {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.patient-card {
  cursor: pointer;
  transition: border-color 0.15s;
}
.patient-card:hover {
  border-color: #78b6ba;
}
.patient-card .person {
  margin-bottom: 20px;
}
.patient-card h3 {
  font-size: 17px;
}
.patient-meta {
  border-top: 1px solid var(--line);
  padding-top: 15px;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.full {
  grid-column: 1/-1;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  max-width: 590px;
  width: calc(100% - 32px);
  box-shadow: 0 30px 100px #17374933;
  color: #193346;
}
dialog::backdrop {
  background: #122c4366;
  backdrop-filter: blur(3px);
}
dialog h2 {
  margin-bottom: 22px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.form-error {
  color: #b43449;
  font-size: 14px;
  line-height: 1.5;
  margin-top: 14px;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #193346;
  color: white;
  padding: 14px 22px;
  border-radius: 10px;
  box-shadow: 0 5px 25px #0002;
  display: none;
  z-index: 10;
  max-width: 90vw;
}
.timeline {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.timeline p {
  white-space: pre-wrap;
  line-height: 1.75;
  margin-top: 10px;
}
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.tabs .active {
  background: var(--brand);
  color: white;
}
.chat {
  max-height: 420px;
  overflow: auto;
}
.bubble {
  padding: 14px 16px;
  background: #f0f5f8;
  border-radius: 10px;
  max-width: 88%;
  margin-bottom: 12px;
  white-space: pre-wrap;
  line-height: 1.5;
}
.bubble.mine {
  background: #e5f4f1;
  margin-left: auto;
}
.bubble small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}
.login-art {
  background: #164e63;
  color: white;
  padding: 70px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-art .logo {
  color: white;
}
.login-art .logo small {
  color: #a9d5df;
}
.login-art h1 {
  font-size: 56px;
  line-height: 1.12;
  max-width: 540px;
  letter-spacing: -2px;
}
.login-art p {
  font-size: 18px;
  line-height: 1.8;
  color: #c3e0e8;
  margin-top: 24px;
  max-width: 450px;
}
.login-art footer {
  color: #b5d1da;
  font-size: 14px;
}
.login-form {
  display: grid;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.login-box {
  width: 100%;
  max-width: 400px;
}
.login-box h2 {
  font-size: 28px;
  margin-bottom: 10px;
}
.login-box form {
  margin-top: 28px;
  display: grid;
  gap: 18px;
}
.login-box .primary {
  padding: 14px;
}
.test-accounts {
  margin-top: 26px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  padding: 18px;
  background: #eaf0f5;
  border-radius: 10px;
}
.test-accounts code {
  font-size: 13px;
  user-select: all;
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  height: 150px;
  margin-top: 25px;
}
.bar-group {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.bar {
  height: var(--height);
  min-height: 3px;
  background: #208d92;
  border-radius: 5px 5px 0 0;
  margin-bottom: 8px;
}
.bar.expense {
  background: #a4bed0;
}
.balance {
  font-size: 28px;
  font-weight: 650;
  margin: 12px 0;
}
.link {
  color: var(--accent);
  text-decoration: none;
}
.form-stack {
  display: grid;
  gap: 16px;
}
a.button {
  display: inline-block;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--brand);
  font-size: 14px;
}
.mobile-title {
  display: none;
}
.pre {
  white-space: pre-wrap;
  line-height: 1.7;
}
.receipt {
  background: #f7fafc;
  border: 1px dashed #a7bdca;
  padding: 24px;
  line-height: 1.9;
}
.receipt h3 {
  font-size: 21px;
  margin-bottom: 10px;
}
@media (max-width: 1100px) {
  .patients {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .content {
    padding: 26px;
  }
  .sidebar {
    width: 215px;
  }
  .shell {
    grid-template-columns: 215px 1fr;
  }
  .topbar {
    padding: 0 26px;
  }
  .login-art {
    padding: 40px;
  }
  .login-art h1 {
    font-size: 43px;
  }
}
@media (max-width: 720px) {
  .shell {
    display: block;
  }
  .sidebar {
    height: auto;
    width: 100%;
    position: relative;
    padding: 16px;
    gap: 15px;
    border-right: 0;
  }
  .sidebar .logo small,
  .sidebar-foot {
    display: none;
  }
  .sidebar .logo {
    font-size: 26px;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
    gap: 4px;
  }
  .sidebar nav button {
    white-space: nowrap;
    padding: 10px;
    font-size: 14px;
  }
  .sidebar .sidebar nav span {
    display: none;
  }
  .topbar {
    height: 62px;
    padding: 0 18px;
  }
  .topbar .muted {
    display: none;
  }
  .content {
    padding: 22px 16px;
  }
  .heading {
    align-items: flex-start;
    gap: 12px;
  }
  .heading h1 {
    font-size: 25px;
  }
  .heading p {
    font-size: 14px;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 16px;
  }
  .stat .value {
    font-size: 25px;
  }
  .patients {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 18px;
  }
  .row {
    flex-wrap: wrap;
  }
  .row .actions {
    width: 100%;
    padding-left: 81px;
  }
  .welcome {
    padding: 22px;
  }
  .welcome h2 {
    font-size: 20px;
  }
  .welcome button {
    display: none;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .full {
    grid-column: auto;
  }
  .login {
    display: block;
  }
  .login-art {
    padding: 26px;
  }
  .login-art h1 {
    font-size: 32px;
    margin-top: 30px;
  }
  .login-art p,
  .login-art footer {
    display: none;
  }
  .login-form {
    padding: 32px 24px;
  }
  .toolbar input {
    width: 100%;
  }
}
@media print {
  .sidebar,
  .topbar,
  .heading,
  .modal-foot,
  body > #app,
  body > #toast {
    display: none;
  }
  dialog {
    position: static;
    display: block;
    max-width: none;
    border: 0;
    box-shadow: none;
    width: 100%;
  }
  dialog::backdrop {
    background: white;
  }
}
.level-0 {
  height: 3px;
}
.level-1 {
  height: 12px;
}
.level-2 {
  height: 23px;
}
.level-3 {
  height: 35px;
}
.level-4 {
  height: 46px;
}
.level-5 {
  height: 58px;
}
.level-6 {
  height: 69px;
}
.level-7 {
  height: 81px;
}
.level-8 {
  height: 92px;
}
.level-9 {
  height: 104px;
}
.level-10 {
  height: 115px;
}
