* { box-sizing: border-box; }

:root {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #172929;
  background: #f3f6f7;
  color-scheme: light;
  --green: #17675e;
  --green-dark: #0d4f47;
  --light: #e6f1ef;
  --line: #dce5e5;
  --muted: #4d6060;
}

body { margin: 0; min-width: 320px; }
a { color: var(--green-dark); text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 3px solid #167a6c; outline-offset: 3px; }
h1, h2, h3, h4, p, dl, dd { margin: 0; }
[hidden] { display: none !important; }

.account { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .55rem; }
.usuario { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.layout-login { display: block; }
.layout-login .sidebar { display: none; }
.layout-login main { display: grid; place-items: center; padding-block: clamp(2rem, 10vh, 7rem); }
.login-card { width: min(100%, 27rem); background: white; border: 1px solid var(--line); border-radius: .85rem; padding: clamp(1rem, 5vw, 2rem); box-shadow: 0 5px 20px #1335300c; }
.login-card h1 { font-size: 1.5rem; margin: .9rem 0 .4rem; }
.login-card > p { color: var(--muted); }
.login-card form { display: grid; gap: .85rem; margin-top: 1.3rem; }
.message { color: #9f2828; font-size: .9rem; }
.message:empty { display: none; }
.button:disabled { cursor: default; opacity: .55; }

.topbar {
  background: white;
  border-bottom: 1px solid var(--line);
  padding: .8rem 1.75rem;
  min-height: 4.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.brand { display: flex; align-items: center; gap: .7rem; color: #173433; font-weight: 750; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; }
.brand-mark, .avatar { display: grid; place-items: center; flex: none; font-weight: 750; }
.brand-mark { width: 2.35rem; height: 2.35rem; border-radius: .7rem; background: var(--green); color: white; }
.demo { padding: .4rem .7rem; border-radius: 2rem; background: #fff3d4; color: #6d4700; font-size: .82rem; font-weight: 650; }

.layout { display: grid; grid-template-columns: 13rem minmax(0, 1fr); min-height: calc(100vh - 4.15rem); }
.sidebar { background: white; border-right: 1px solid var(--line); padding: 1.1rem .85rem; }
.sidebar a { display: block; padding: .7rem; border-radius: .45rem; background: var(--light); font-size: .9rem; font-weight: 650; }
main { width: 100%; max-width: 92rem; padding: 1.8rem clamp(1rem, 3vw, 2.7rem) 3rem; margin: 0 auto; }
main:focus { outline: none; }

.page-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; margin-bottom: 1.45rem; }
.page-heading h1 { font-size: clamp(1.55rem, 2.3vw, 2.05rem); letter-spacing: -.045em; }
.page-heading p { color: var(--muted); margin-top: .38rem; }
.breadcrumbs { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; color: var(--muted); margin-bottom: 1rem; font-size: .86rem; }
.breadcrumbs a:hover { text-decoration: underline; }

.filter-panel, .card, .group-summary { background: white; border: 1px solid var(--line); border-radius: .7rem; }
.filter-panel { padding: 1rem; margin-bottom: 1.45rem; }
.filter-panel h2 { font-size: 1.07rem; margin-bottom: .85rem; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; }
label { display: grid; min-width: 0; gap: .35rem; font-size: .88rem; font-weight: 620; }
input, select { width: 100%; min-height: 2.6rem; min-width: 0; border: 1px solid #cbd7d7; border-radius: .42rem; color: #172929; background: white; padding: .45rem .65rem; }
select { text-overflow: ellipsis; }
.actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: .9rem; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 2.55rem; border: 1px solid transparent; padding: .52rem .9rem; border-radius: .44rem; background: var(--green); color: white; font-size: .9rem; font-weight: 650; }
.button:hover { background: var(--green-dark); }
.button-light { background: white; color: var(--green-dark); border-color: #a9c5c0; }
.button-light:hover { background: var(--light); }
.button-wide { width: 100%; margin-top: auto; }
.search { display: flex; gap: .8rem; align-items: end; }
.search label { flex: 1; max-width: 27rem; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .85rem; }
.section-heading h2 { font-size: 1.2rem; }
.section-heading span, .card-heading p, .group-modalidade { color: var(--muted); font-size: .9rem; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.card { display: flex; flex-direction: column; min-width: 0; padding: 1rem; box-shadow: 0 2px 5px #13353009; }
.card-heading { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.card-heading h3 { font-size: 1rem; overflow-wrap: anywhere; }
.card-heading p { margin-top: .17rem; }
.avatar { width: 2.45rem; height: 2.45rem; border-radius: .6rem; background: var(--light); color: var(--green-dark); }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: .85rem 0; padding: .7rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: .875rem; }
dd { margin-top: .18rem; font-weight: 650; overflow-wrap: anywhere; }
.metrics dd { font-size: 1.25rem; }
.metrics .date { font-size: .95rem; }
.group-modalidade { margin-top: .55rem; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: .25rem .48rem; border-radius: .35rem; background: #edf0f3; color: #435162; font-size: .8rem; font-weight: 650; }
.badge-active { background: var(--light); color: var(--green-dark); }
.empty { grid-column: 1 / -1; border: 1px dashed #b6c7c7; border-radius: .6rem; background: white; color: var(--muted); padding: 1.5rem 1rem; text-align: center; }
.group-summary { padding: 1rem; margin-bottom: 1.45rem; }
.group-summary dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .9rem; }
.client h4 { font-size: .94rem; margin: .85rem 0 .4rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.detail-list { display: grid; gap: .45rem; }
.detail-list dd { font-size: .9rem; font-weight: 500; }

@media (max-width: 1040px) {
  .layout { grid-template-columns: 10rem minmax(0, 1fr); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topbar { padding-inline: 1rem; }
  .layout { display: block; }
  .sidebar { display: none; }
  main { padding-top: 1.25rem; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 490px) {
  .cards, .filter-grid { grid-template-columns: 1fr; }
  .page-heading, .search { align-items: stretch; flex-direction: column; }
  .page-heading .button { align-self: start; }
  .demo { text-align: center; }
}
