:root {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  color: #202a3b;
  background: #f6f8fc;
  font-size: 15px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.55rem, 3vw, 2rem);
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}

h2 {
  font-size: 1.05rem;
  margin: 0;
}

p {
  color: #68758a;
  line-height: 1.6;
}

.topbar {
  background: white;
  border-bottom: 1px solid #e7eaf1;
  padding: 15px max(20px, calc((100vw - 1160px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand strong {
  display: block;
  font-size: 1.24rem;
  letter-spacing: -0.04em;
}

.brand small {
  display: block;
  color: #758096;
  font-size: 0.74rem;
}

.logo {
  display: grid;
  place-items: center;
  background: #3d4caa;
  color: white;
  font-weight: 800;
  border-radius: 13px;
  width: 42px;
  height: 42px;
  font-size: 23px;
}

.account {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.85rem;
  color: #68758a;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 38px 20px 64px;
}

.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 28px;
}

.eyebrow {
  color: #4e5cc0;
  font-size: 0.73rem;
  letter-spacing: 0.1em;
  font-weight: 800;
  margin-bottom: 10px;
}

.tag {
  background: #e8ecff;
  color: #3445a1;
  padding: 7px 12px;
  border-radius: 30px;
  font-size: 0.77rem;
  font-weight: 700;
}

.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid #e0e5ee;
  margin-bottom: 26px;
  overflow: auto;
}

.tabs button {
  border: 0;
  background: none;
  color: #68758a;
  padding: 13px 16px;
  white-space: nowrap;
  font-weight: 650;
  border-bottom: 3px solid transparent;
}

.tabs button.selected {
  color: #3e4daf;
  border-color: #4e5cc0;
}

.toolbar {
  display: flex;
  gap: 15px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 220px;
  flex: 1;
}

.field label,
label {
  font-size: 0.81rem;
  font-weight: 700;
  color: #46546a;
}

input,
select,
textarea {
  border: 1px solid #dce2ed;
  border-radius: 10px;
  padding: 12px 13px;
  background: white;
  color: #273347;
  outline: none;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #6774cf;
  box-shadow: 0 0 0 3px #6774cf22;
}

textarea {
  resize: vertical;
  min-height: 75px;
}

.counter {
  font-size: 0.8rem;
  color: #738095;
  padding-bottom: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.card,
.panel {
  background: white;
  border: 1px solid #e6eaf1;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 3px 16px #192b4c05;
}

.card-top {
  display: flex;
  align-items: start;
  gap: 12px;
}

.ucnum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  background: #edf0ff;
  color: #4555b2;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 800;
  font-size: 0.78rem;
}

.card h2 {
  line-height: 1.4;
}

.card p {
  font-size: 0.85rem;
  margin: 13px 0 20px;
}

.muted {
  color: #8691a2;
  font-size: 0.75rem;
}

.options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.option {
  border: 1px solid #dfe4ec;
  border-radius: 9px;
  padding: 10px 5px;
  background: #fff;
  font-size: 0.77rem;
  font-weight: 650;
  color: #59677d;
}

.option.active.total {
  background: #e7f6ed;
  border-color: #60bd86;
  color: #177448;
}

.option.active.parcial {
  background: #fff3da;
  border-color: #edba55;
  color: #93600a;
}

.option.active.nao {
  background: #fce8e8;
  border-color: #e9a3a3;
  color: #a13c3c;
}

.notes {
  margin-top: 14px;
}

.notes label {
  display: block;
  margin-bottom: 6px;
}

.notes button {
  margin-top: 7px;
}

.primary,
.secondary,
.ghost {
  border-radius: 9px;
  padding: 10px 15px;
  font-weight: 700;
  border: 1px solid #dfe4ec;
}

.primary {
  background: #4353b1;
  color: white;
  border-color: #4353b1;
}

.primary:hover {
  background: #35449e;
}

.secondary {
  background: white;
  color: #3d4caa;
}

.ghost {
  background: transparent;
  color: #4a5870;
}

.full {
  width: 100%;
}

.small {
  font-size: 0.8rem;
  padding: 8px 11px;
}

.notice {
  padding: 12px 16px;
  border-radius: 10px;
  background: #e8f5ed;
  color: #1c724a;
  margin-bottom: 20px;
}

.error {
  color: #b53434;
  margin-top: 12px;
  font-size: 0.85rem;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at top left, #e5e9ff, #f6f8fc 55%);
}

.login-card {
  background: white;
  border: 1px solid #e3e7f0;
  border-radius: 22px;
  padding: 36px;
  width: min(100%, 440px);
  box-shadow: 0 20px 80px #22336915;
}

.login-card h1 {
  margin: 34px 0 8px;
}

.login-card p {
  font-size: 0.91rem;
}

.login-card form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.login-card label {
  display: grid;
  gap: 7px;
}

.login-card .primary {
  padding: 13px;
}

.empty {
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed #cbd4e4;
  border-radius: 16px;
  background: white;
  color: #65758c;
}

.panel {
  margin-bottom: 16px;
}

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

.list {
  display: grid;
  gap: 10px;
}

.person {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 10px;
  background: #f8f9fc;
}

.pill {
  font-size: 0.75rem;
  font-weight: 750;
  border-radius: 50px;
  padding: 6px 10px;
  white-space: nowrap;
}

.pill.total {
  background: #e5f6eb;
  color: #177448;
}

.pill.parcial {
  background: #fff2d9;
  color: #916007;
}

.pill.nao {
  background: #fdeaea;
  color: #9d3535;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

td,
th {
  padding: 13px;
  border-bottom: 1px solid #e9edf4;
  font-size: 0.85rem;
}

th {
  font-size: 0.77rem;
  color: #68758a;
}

footer {
  text-align: center;
  padding: 22px;
  color: #9aa4b4;
  font-size: 0.78rem;
}

.admin-only {
  display: none !important;
}

body.is-admin .admin-only {
  display: inline-block !important;
}

@media (max-width: 650px) {
  .container {
    padding: 24px 14px;
  }

  .topbar {
    padding: 13px 15px;
  }

  .brand small {
    font-size: 0.65rem;
  }

  .account #who {
    display: none;
  }

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

  .card {
    padding: 18px;
  }

  .heading {
    align-items: start;
  }

  .toolbar {
    display: grid;
  }

  .field {
    min-width: 0;
  }

  .counter {
    padding: 0;
  }

  .login-card {
    padding: 26px;
  }
}

/* Controle visual por papel e respeito ao atributo hidden */
[hidden] {
  display: none !important;
}

body.is-admin [data-tab='fill'] {
  display: none !important;
}

.notes-saved {
  padding: 12px;
  background: #f6f8fc;
  border-radius: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.87rem;
  color: #36455a;
}

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

.password-dialog {
  width: min(94vw, 460px);
  border: 1px solid #e0e5ee;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 20px 90px #17223c30;
}

.password-dialog::backdrop {
  background: #17223c88;
}

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

.password-dialog label {
  display: grid;
  gap: 6px;
}

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

.account {
  flex-wrap: wrap;
}
