:root {
  --navy: #050b25;
  --ivory: #f8f5ed;
  --blue: #bcdcf5;
  --ink: #17233b;
  --muted: #59677a;
  --border: #dbe2eb;
  --paper: #fff;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #f3f5f8;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #3088c4;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 36px;
  letter-spacing: -1.2px;
}
h2 {
  font-size: 25px;
  letter-spacing: -0.5px;
}
h3 {
  font-size: 17px;
}
p {
  line-height: 1.6;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid #bec9d6;
  border-radius: 7px;
  background: white;
  padding: 11px 12px;
  color: var(--ink);
  font-weight: 400;
  min-height: 43px;
}
textarea {
  resize: vertical;
  line-height: 1.5;
}
input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  accent-color: var(--navy);
  flex-shrink: 0;
}
input:disabled,
select:disabled,
textarea:disabled {
  background: #f1f3f6;
  color: #556277;
}
small,
.muted {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 12px;
}
.primary,
.secondary,
.danger {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 11px 17px;
  font-size: 13px;
  font-weight: 650;
  min-height: 42px;
}
.primary {
  background: var(--navy);
  color: var(--ivory);
}
.primary:hover {
  background: #172846;
}
.secondary {
  background: white;
  border-color: var(--border);
  color: var(--ink);
}
.secondary:hover {
  background: #edf3f8;
}
.danger {
  background: #fff1ef;
  color: #a12620;
  border-color: #f2cec9;
}
.link-button {
  background: none;
  border: 0;
  color: #285e87;
  padding: 10px 0;
  text-align: left;
  font-size: 13px;
}
.icon-button {
  border: 0;
  background: transparent;
  font-size: 27px;
  padding: 2px 10px;
  color: var(--muted);
}
.check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  line-height: 1.5;
}
.info {
  background: #edf5fc;
  border: 1px solid #c8dfef;
  padding: 13px;
  border-radius: 7px;
  font-size: 13px;
}
.skip {
  position: fixed;
  top: -100px;
}
.skip:focus {
  top: 0;
  background: white;
  padding: 12px;
  z-index: 20;
}
#notice {
  position: fixed;
  right: 24px;
  top: 20px;
  max-width: 480px;
  padding: 16px 20px;
  background: var(--navy);
  color: white;
  border-radius: 8px;
  z-index: 100;
  box-shadow: 0 8px 30px #0002;
}
#notice.error {
  background: #8b2727;
}
.login-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100svh;
}
.login-brand {
  background: var(--navy);
  color: var(--ivory);
  padding: 60px 12%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-brand img {
  width: 170px;
}
.login-brand h1 {
  font-size: clamp(36px, 4.5vw, 65px);
  line-height: 1.1;
  letter-spacing: -2px;
}
.login-brand .eyebrow {
  color: var(--blue);
}
.login-brand > span {
  color: var(--blue);
  font-size: 13px;
}
.login-content {
  display: grid;
  place-items: center;
  padding: 40px;
}
.login-card {
  width: min(100%, 380px);
}
.login-card form {
  margin-top: 28px;
}
.login-card .primary {
  width: 100%;
}
.back-link {
  display: block;
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--muted);
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 230px;
  background: var(--navy);
  color: var(--ivory);
  padding: 32px 22px;
  display: flex;
  flex-direction: column;
}
.sidebar img {
  width: 145px;
  margin-bottom: 50px;
}
.sidebar nav {
  display: grid;
  gap: 8px;
}
.sidebar nav button {
  color: #b8c5db;
  border: 0;
  background: none;
  text-align: left;
  padding: 14px 16px;
  border-radius: 7px;
  font-weight: 600;
}
.sidebar nav button.selected {
  background: #21334e;
  color: white;
}
.account {
  margin-top: auto;
  display: grid;
  gap: 12px;
  font-size: 13px;
  padding: 20px 8px 0;
}
.sidebar-link {
  background: none;
  border: 0;
  color: #b8c5db;
  text-align: left;
  padding: 0;
  font-size: 12px;
}
.content {
  margin-left: 230px;
  padding: 46px clamp(24px, 4vw, 70px);
  max-width: 1700px;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}
.page-header h1 {
  margin-bottom: 0;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.toolbar input {
  max-width: 450px;
}
.toolbar p {
  margin: 0;
}
.table-wrap {
  overflow: auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  padding: 17px 20px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.4px;
  background: #fafbfc;
}
td {
  padding: 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  white-space: nowrap;
}
td strong,
td small {
  display: block;
  line-height: 1.8;
}
td strong {
  font-size: 14px;
}
td small {
  max-width: 320px;
  white-space: normal;
}
.status {
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 20px;
  background: #edf1f6;
  color: #495e78;
}
.status.aprovado {
  background: #e4f3e9;
  color: #247047;
}
.status.enviado {
  background: #e6f1fb;
  color: #286291;
}
.status.recusado,
.status.cancelado {
  background: #f9eae7;
  color: #9b4d40;
}
.empty {
  text-align: center;
  padding: 60px;
  color: var(--muted);
}
.pagination {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 24px;
  font-size: 13px;
}
.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.wide {
  grid-column: 1/-1;
}
.panel > label:last-child {
  margin-bottom: 0;
}
dialog {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  max-height: 94svh;
  width: min(620px, 94vw);
  color: var(--ink);
  box-shadow: 0 24px 90px #0003;
}
dialog::backdrop {
  background: #030a24a6;
  backdrop-filter: blur(3px);
}
.editor-dialog {
  width: min(1200px, 96vw);
  padding: 0;
  background: #f3f5f8;
}
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}
.dialog-header h2 {
  margin-bottom: 0;
}
.editor-dialog .dialog-header {
  padding: 25px 30px;
  background: white;
  margin: 0;
  border-bottom: 1px solid var(--border);
}
.editor-dialog .info {
  margin: 20px 28px 0;
}
.editor-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 24px;
  padding: 24px 28px;
}
.editor-fields {
  min-width: 0;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}
.section-heading h3 {
  margin: 0;
}
.summary {
  align-self: start;
  position: sticky;
  top: 0;
}
.summary dl {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 13px;
}
.summary dd {
  margin: 0;
  font-weight: 600;
}
.total {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  margin-top: 20px;
  display: grid;
  gap: 8px;
}
.total span {
  font-size: 12px;
  color: var(--muted);
}
.total strong {
  font-size: 28px;
  letter-spacing: -1px;
}
.summary .secondary {
  width: 100%;
}
.summary .muted {
  margin-top: 15px;
}
.item {
  padding: 18px 0;
  border-top: 1px solid var(--border);
}
.item:first-child {
  padding-top: 0;
  border-top: 0;
}
.item-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr auto;
  gap: 10px;
  align-items: end;
}
.item-fields label {
  margin-bottom: 0;
}
.item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 13px;
}
.item textarea {
  min-height: 64px;
}
.editor-footer {
  position: sticky;
  bottom: 0;
  background: white;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 28px;
  border-top: 1px solid var(--border);
}
.spacer {
  flex: 1;
}
.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.user-grid .panel {
  margin: 0;
}
.permissions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  margin: 20px 0;
}
.history-entry {
  padding: 18px 0;
  border-top: 1px solid var(--border);
}
.history-entry p {
  margin: 8px 0;
  font-size: 13px;
}
#settings-view {
  max-width: 850px;
}
@media (max-width: 850px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 20px;
    display: block;
  }
  .sidebar img {
    width: 110px;
    margin: 0 0 20px;
  }
  .sidebar nav {
    display: flex;
    flex-wrap: wrap;
  }
  .sidebar nav button {
    padding: 10px;
  }
  .account {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 15px 0 0;
  }
  .content {
    margin-left: 0;
    padding: 28px 18px;
  }
  .editor-body {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .summary {
    position: static;
  }
  .login-layout {
    grid-template-columns: 1fr;
  }
  .login-brand {
    min-height: 240px;
    padding: 30px;
  }
  .login-brand h1 {
    font-size: 36px;
    margin: 25px 0 12px;
  }
  .login-brand > span,
  .login-brand .eyebrow {
    display: none;
  }
  .login-content {
    padding: 35px 24px;
  }
  .editor-footer {
    padding: 14px;
  }
  .editor-footer .spacer {
    display: none;
  }
  .page-header {
    align-items: flex-start;
  }
  h1 {
    font-size: 29px;
  }
}
@media (max-width: 520px) {
  .form-grid,
  .permissions {
    grid-template-columns: 1fr;
  }
  .item-fields {
    grid-template-columns: 1fr 1fr;
  }
  .panel {
    padding: 17px;
  }
  .section-heading {
    align-items: flex-start;
  }
  .dialog-header h2 {
    font-size: 21px;
  }
  .editor-dialog .dialog-header {
    padding: 20px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .editor-footer button {
    flex: 1;
    white-space: nowrap;
  }
  .page-header {
    flex-wrap: wrap;
  }
  .pagination {
    justify-content: center;
  }
  .login-brand > div > p:last-child {
    font-size: 14px;
  }
}
.history-entry pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    12px/1.7 "Segoe UI",
    sans-serif;
  background: #f3f5f8;
  padding: 16px;
}
.history-entry summary {
  font-size: 13px;
  cursor: pointer;
  margin: 12px 0;
}
.history-entry button {
  margin-top: 10px;
}
button[data-busy="true"] {
  opacity: 0.6;
  cursor: wait;
}
#security-dialog {
  max-width: 520px;
}
#security-dialog p {
  margin-bottom: 18px;
}
.mfa-qr {
  display: block;
  width: 220px;
  max-width: 100%;
  margin: 18px auto;
  background: white;
}
#mfa-secret {
  display: block;
  overflow-wrap: anywhere;
  user-select: all;
  padding: 12px 0;
}
#mfa-enroll-form details {
  margin-bottom: 20px;
}
#mfa-login-form input,
#mfa-enroll-form input {
  letter-spacing: 0.3em;
}
