@import url('./tokens.css');
:root {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--canvas);
  --panel: var(--surface);
  --line: var(--stroke);
  --muted: var(--muted-text);
  --accent: var(--action);
  --release-height: calc(24px + env(safe-area-inset-bottom, 0px));
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  background: var(--control);
  border: 1px solid var(--stroke-control);
  border-radius: 8px;
  padding: 0.58rem 0.9rem;
  font-size: 0.89rem;
  font-weight: 600;
}
button:hover {
  background: #28374b;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.mast {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 50px);
  background: var(--header);
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.brand,
.account,
.actions,
.box-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand strong {
  font-size: 1.12rem;
  letter-spacing: -0.035em;
}
.brand b {
  color: var(--accent);
}
.brand div > span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 2px;
}
.mark {
  display: grid;
  position: relative;
  align-items: center;
  justify-items: center;
  background: var(--action);
  width: 39px;
  height: 39px;
  border-radius: 10px;
}
.mark i {
  position: absolute;
  width: 17px;
  height: 12px;
  border: 2px solid white;
  transform: rotate(-31deg) skewX(26deg);
  background: var(--action);
  top: 19px;
}
.mark i:nth-child(2) {
  top: 15px;
}
.mark i:nth-child(3) {
  top: 11px;
}
.account {
  color: #bac7d7;
  font-size: 0.84rem;
}
.entry {
  min-height: calc(100dvh - 70px);
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: radial-gradient(
    ellipse at 50% 32%,
    #172638 0%,
    #0c141f 48%,
    var(--canvas) 80%
  );
}
.login-card,
.box,
dialog {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.login-card {
  padding: clamp(24px, 4vw, 44px);
  width: min(100%, 430px);
  box-shadow: 0 24px 80px #0005;
}
.kicker {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  font-weight: 750;
  margin: 0 0 10px;
}
h1 {
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  line-height: 1.14;
  letter-spacing: -0.05em;
  margin: 0;
}
h2 {
  font-size: 1.14rem;
  letter-spacing: -0.025em;
  margin: 0;
}
.muted {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.9rem;
}
.login-card form {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 600;
}
input,
select {
  min-width: 0;
  color: #f2f6fa;
  background: #0a121f;
  border: 1px solid var(--stroke-control);
  border-radius: 7px;
  padding: 0.67rem 0.75rem;
  font-size: 0.91rem;
}
input:disabled {
  opacity: 0.65;
}
input[type='file'] {
  padding: 0.45rem;
  width: 100%;
}
input::file-selector-button {
  background: #223147;
  border: 0;
  color: #e7edf4;
  padding: 0.37rem 0.5rem;
  border-radius: 4px;
  margin-right: 8px;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-action);
}
.primary:hover {
  background: #ffa362;
}
.status {
  display: block;
  line-height: 1.45;
  font-size: 0.87rem;
  color: #9be0c1;
}
.status:empty {
  display: none;
}
.status[data-error='true'] {
  color: #ffc0aa;
}
#nav,
.subnav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}
#nav {
  background: var(--header);
  border-bottom: 1px solid var(--line);
  padding: 7px clamp(10px, 3vw, 50px);
  min-height: 49px;
}
#nav button,
.subnav button {
  background: transparent;
  border-color: transparent;
  color: #b4c2d3;
  white-space: nowrap;
}
#nav button[aria-current='page'],
.subnav button[aria-pressed='true'] {
  background: #38261d;
  color: var(--focus-ring);
  border-color: #775038;
}
#nav button:hover,
.subnav button:hover {
  color: #fff;
}
#module iframe {
  width: 100%;
  height: calc(100dvh - 119px);
  min-height: 400px;
  display: block;
  border: 0;
}
.settings {
  max-width: 1180px;
  margin: auto;
  padding: clamp(20px, 3vw, 42px) clamp(15px, 3vw, 34px);
}
.settings-head {
  margin-bottom: 20px;
}
.subnav {
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.pane {
  display: grid;
  gap: 16px;
}
.box {
  padding: clamp(16px, 2.1vw, 26px);
}
.rowform,
.user-form {
  display: grid;
  align-items: end;
  gap: 15px;
  margin-top: 18px;
}
.rowform {
  grid-template-columns: 1.3fr 1fr auto;
}
.user-form {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.actions {
  flex-wrap: wrap;
}
.box-head {
  justify-content: space-between;
}
.listing {
  display: grid;
  margin-top: 14px;
}
.item {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.item b,
.item small {
  display: block;
  overflow-wrap: anywhere;
}
.item small {
  color: var(--muted);
  margin-top: 4px;
}
.item .actions {
  gap: 7px;
}
.item .actions select {
  padding: 0.53rem;
}
.danger {
  color: #ffc3b6;
}
.settings > .status {
  position: sticky;
  bottom: 12px;
  background: #182535;
  border: 1px solid #3b4f63;
  border-radius: 8px;
  padding: 11px 14px;
  margin-top: 12px;
}
.empty {
  color: var(--muted);
  font-size: 0.9rem;
}
.pane iframe {
  width: 100%;
  border: 0;
  min-height: 680px;
  height: calc(100dvh - 245px);
}
dialog {
  color: inherit;
  max-width: min(440px, 94vw);
  padding: 24px;
}
dialog::backdrop {
  background: #050910b8;
}
dt {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 15px;
}
dd {
  margin: 4px 0 0;
}
@media (max-width: 720px) {
  .mast {
    height: 61px;
  }
  .account {
    gap: 7px;
  }
  .brand strong {
    font-size: 1rem;
  }
  .rowform,
  .user-form {
    grid-template-columns: 1fr;
  }
  .item {
    align-items: start;
    flex-direction: column;
  }
  #module iframe {
    height: calc(100dvh - 110px);
  }
  .entry {
    min-height: calc(100dvh - 61px);
  }
}
#base-export iframe {
  min-height: 0;
  height: 375px;
}
.rowform {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}
#map-fields {
  grid-column: 1/-1;
  font-size: 0.87rem;
  color: var(--muted);
}
summary {
  cursor: pointer;
}
#activity-list {
  max-height: 22rem;
  overflow: auto;
}
#pane-excel iframe.dialog-expanded {
  position: fixed;
  inset: 0;
  z-index: 50;
  height: 100dvh;
  min-height: 0;
}
.mast {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  padding-inline: clamp(14px, 2vw, 32px);
}
.brand {
  display: contents;
}
.brand .mark {
  grid-column: 1;
  justify-self: start;
}
.brand > div {
  grid-column: 2;
  display: flex;
  align-items: center;
}
.brand strong {
  color: var(--action);
  font-size: clamp(1.05rem, 1.4vw, 1.32rem);
  font-weight: 800;
}
.brand b {
  color: var(--text);
}
.brand div > span {
  color: var(--body-text);
  border-left: 1px solid var(--stroke-control);
  padding-left: 0.8rem;
  margin: 0 0 0 0.8rem;
  font-size: clamp(0.9rem, 1.25vw, 1.16rem);
  font-weight: 650;
  letter-spacing: -0.025em;
}
.account {
  grid-column: 3;
  justify-self: end;
}
#nav {
  justify-content: safe center;
  align-items: center;
  background: var(--canvas);
  gap: 6px;
}
#nav button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.49rem 0.9rem;
  border-radius: var(--radius-control);
  color: var(--muted-text);
}
#nav button svg {
  width: 1.02rem;
  height: 1.02rem;
  flex: none;
}
#nav button[aria-current='page'] {
  color: var(--on-action);
  background: var(--action);
  border-color: var(--action);
  box-shadow: 0 2px 9px #f9731626;
}
#nav button:not([aria-current]):hover {
  color: var(--text);
  background: var(--surface-raised);
}
.subnav button[aria-pressed='true'] {
  color: var(--focus-ring);
  background: #302016;
  border-color: #8b512e;
}
button.primary {
  color: var(--on-action);
}
#official-data a {
  color: var(--history);
  text-underline-offset: 0.18em;
}
#official-data a:focus-visible,
#official-data summary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}
#official-data details {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 0.5rem;
}
#official-data summary {
  font-weight: 650;
}
@media (max-width: 760px) {
  .mast {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.65rem;
  }
  .brand > div {
    flex-direction: column;
    align-items: flex-start;
  }
  .brand div > span {
    margin: 0;
    border: 0;
    padding: 0;
    font-size: 0.7rem;
  }
  .account {
    min-width: 0;
  }
  #who {
    max-width: 23vw;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
  }
}

#excel-tools {
  margin-bottom: 1rem;
}
#excel-tools [aria-pressed='true'] {
  border-color: #fb923c;
  color: #fdba74;
}

body {
  padding-bottom: var(--release-height);
}
.release-footer {
  position: fixed;
  inset: auto 0 0;
  z-index: 5;
  height: var(--release-height);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
  padding: 0 max(14px, env(safe-area-inset-right)) env(safe-area-inset-bottom);
  color: var(--muted);
  background: var(--header);
  border-top: 1px solid var(--line);
  font-size: 12px;
}
#release-version {
  padding: 0 0.25rem;
  min-height: 22px;
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#release-history {
  width: min(36rem, 94vw);
  max-width: 94vw;
  max-height: 80dvh;
  padding: 0;
}
#release-history[open] {
  display: flex;
  flex-direction: column;
}
#release-history header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
#release-notes {
  overflow-y: auto;
  padding: 0 18px 12px;
}
#release-notes section + section {
  border-top: 1px solid var(--line);
}
#release-notes h3 {
  margin: 16px 0 6px;
  font-size: 1rem;
  color: var(--focus-ring);
}
#release-notes ul {
  margin: 0 0 14px;
  padding-left: 1.3rem;
  color: var(--body-text);
  font-size: 0.9rem;
  line-height: 1.5;
}
.entry {
  min-height: calc(100dvh - 70px - var(--release-height));
}
#module iframe {
  height: calc(100dvh - 119px - var(--release-height));
}
@media (max-width: 720px) {
  .entry {
    min-height: calc(100dvh - 61px - var(--release-height));
  }
  #module iframe {
    height: calc(100dvh - 110px - var(--release-height));
  }
}
#module iframe[hidden] {
  display: none;
}

.module-bar:has(#analysis-book:not([hidden])) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-inline: clamp(8px, 1.5vw, 24px);
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
}
.module-bar:has(#analysis-book:not([hidden])) #nav {
  min-width: 0;
  flex: 1;
  border: 0;
  padding-inline: 0;
}
#analysis-title {
  font-size: 0.88rem;
  white-space: nowrap;
}
#analysis-book {
  flex: none;
  white-space: nowrap;
  border-radius: 2rem;
  border: 1px solid #257a64;
  color: #8df4c3;
  background: #113a30;
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
}
[data-tema='claro'] #analysis-book {
  color: #145c40;
  background: #e3f7ec;
  border-color: #81cbaa;
}
@media (max-width: 1180px) {
  #analysis-title {
    display: none;
  }
}
