@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;600;700;800&display=swap");
:root {
  --ink: #152b36;
  --muted: #6d7c84;
  --line: #e1e8e8;
  --green: #126c5a;
  --lime: #d9ef9d;
  --paper: #f5f8f7;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    14px "DM Sans",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 9px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 600;
}
button:hover {
  border-color: var(--green);
  background: #eef5f1;
}
button.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
input,
select,
textarea {
  border: 1px solid var(--line);
  padding: 11px;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  max-width: 100%;
}
textarea {
  width: 100%;
  min-height: 160px;
}
aside {
  width: 235px;
  background: #102c32;
  color: #dce7e7;
  position: fixed;
  inset: 0 auto 0 0;
  padding: 30px 19px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand {
  color: white;
  text-decoration: none;
  font: 800 24px Manrope;
  position: relative;
  padding-left: 49px;
}
.brand span {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  width: 38px;
  height: 42px;
  background: var(--lime);
  color: #163b35;
}
.brand small {
  display: block;
  font: 10px "DM Sans";
  letter-spacing: 3px;
  margin-top: 3px;
}
.workspace {
  font-size: 9px;
  letter-spacing: 1px;
  margin: 40px 10px 13px;
  color: #8da9ae;
}
nav button {
  border: 0;
  background: transparent;
  color: #b9cbce;
  width: 100%;
  text-align: left;
  padding: 13px 15px;
  margin: 3px 0;
  font-weight: 500;
}
nav button.active {
  background: #24464b;
  color: var(--lime);
}
nav button:hover {
  background: #24464b;
}
.aside-foot {
  margin-top: auto;
  padding: 25px 13px;
  font: 600 19px Manrope;
  line-height: 1.6;
}
.aside-foot small {
  font: 10px "DM Sans";
  display: block;
  color: #93a9ad;
  margin-top: 15px;
}
.shell {
  margin-left: 235px;
}
header {
  height: 83px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 38px;
  gap: 20px;
  background: #fff;
}
.breadcrumb {
  flex: 1;
  color: var(--muted);
}
.breadcrumb span {
  padding: 0 14px;
  color: #b8c1c3;
}
.breadcrumb b {
  color: var(--ink);
}
.avatar {
  background: #ebf0e4;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}
#menu {
  display: none;
}
main {
  max-width: 1500px;
  margin: auto;
  padding: 34px 38px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.eyebrow {
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
}
h1 {
  font: 800 32px Manrope;
  margin: 10px 0;
}
h2 {
  font: 700 19px Manrope;
  margin: 0 0 7px;
}
h3 {
  font: 700 16px Manrope;
}
p {
  color: var(--muted);
  line-height: 1.6;
}
.notice {
  padding: 12px 16px;
  background: #fff5dc;
  color: #766021;
  border-radius: 9px;
  margin: 23px 0;
  font-size: 12px;
}
#filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
#search {
  flex: 1;
  min-width: 180px;
}
#filters input[type="date"] {
  width: 145px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin: 22px 0;
}
.card,
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}
.card .label {
  color: var(--muted);
  font-size: 12px;
}
.card .value {
  font: 800 29px Manrope;
  margin: 12px 0;
}
.card small {
  color: var(--muted);
  font-size: 11px;
}
.card:first-child {
  background: #163f3e;
  color: white;
  border: 0;
}
.card:first-child .label,
.card:first-child small {
  color: #b7d1ca;
}
.grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  margin: 20px 0;
}
.panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.panel-top p {
  font-size: 12px;
  margin: 0;
}
.pill {
  display: inline-block;
  font-size: 10px;
  border-radius: 20px;
  padding: 5px 9px;
  background: #e9f4eb;
  color: #23704d;
}
.pill.warn {
  background: #fff0d5;
  color: #91620c;
}
.pill.bad {
  background: #fde9e8;
  color: #a14a46;
}
.table-wrap {
  overflow: auto;
  margin-top: 18px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  white-space: nowrap;
}
th {
  text-align: left;
  padding: 13px 12px;
  background: #f5f8f7;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
td {
  padding: 16px 12px;
  border-bottom: 1px solid #edf0ef;
}
td strong {
  display: block;
  font-weight: 600;
}
td small {
  color: var(--muted);
}
.alert {
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
}
.alert p {
  font-size: 12px;
  margin: 5px 0;
}
.alert:last-child {
  border: 0;
}
.empty {
  text-align: center;
  padding: 55px 20px;
}
.empty .symbol {
  font: 800 45px Manrope;
  color: #80ad99;
}
.empty h2 {
  margin-top: 20px;
}
.empty p {
  max-width: 490px;
  margin: 12px auto 22px;
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 15px;
}
.bar-row {
  display: grid;
  grid-template-columns: 85px 1fr 85px;
  gap: 12px;
  align-items: center;
  font-size: 11px;
  margin: 16px 0;
}
.bar-track {
  background: #edf2ef;
  height: 15px;
  border-radius: 5px;
  overflow: hidden;
}
.bar {
  background: #70a892;
  height: 100%;
  border-radius: 5px;
}
.bar-row:nth-child(even) .bar {
  background: #c7dd91;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 20px 0;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}
.full {
  grid-column: 1/-1;
}
.connection {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.connection h3 {
  margin: 0 0 6px;
}
.connection p {
  font-size: 12px;
  margin: 0;
}
.big-banner {
  background: #e4eddb;
  border-radius: 14px;
  padding: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.big-banner h2 {
  font-size: 24px;
}
.checklist {
  list-style: none;
  padding: 0;
}
.checklist li {
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
  display: flex;
  justify-content: space-between;
  gap: 15px;
}
footer {
  padding: 20px 38px;
  color: var(--muted);
  font-size: 10px;
}
dialog {
  border: 0;
  border-radius: 15px;
  box-shadow: 0 20px 80px #0003;
  width: min(750px, 94vw);
  padding: 28px;
  max-height: 90vh;
}
dialog::backdrop {
  background: #102c3280;
}
#closeDialog {
  margin-top: 20px;
}
#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #153b36;
  color: white;
  padding: 14px 20px;
  border-radius: 10px;
  display: none;
  z-index: 100;
}
pre {
  white-space: pre-wrap;
  font: 12px "DM Sans";
  line-height: 1.8;
  background: #f5f8f7;
  padding: 20px;
  border-radius: 10px;
}
.metric-positive {
  color: #217258;
}
.muted {
  color: var(--muted);
}
.creative {
  border-left: 3px solid #81a991;
  padding: 15px 20px;
  background: #f5f8f7;
  margin: 15px 0;
}
.creative h3 {
  margin: 0 0 10px;
}
.print-head {
  display: none;
}
@media (max-width: 1050px) {
  aside {
    width: 200px;
  }
  .shell {
    margin-left: 200px;
  }
  main {
    padding: 25px;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid {
    grid-template-columns: 1fr;
  }
  header {
    padding: 0 25px;
  }
}
@media (max-width: 700px) {
  aside {
    display: none;
    width: 235px;
  }
  body.menu-open aside {
    display: flex;
  }
  .shell {
    margin: 0;
  }
  #menu {
    display: block;
  }
  header {
    padding: 0 15px;
    height: 65px;
    gap: 10px;
  }
  .breadcrumb {
    font-size: 11px;
  }
  .breadcrumb span {
    padding: 0 5px;
  }
  #importTop {
    font-size: 11px;
    padding: 8px;
  }
  .avatar {
    display: none;
  }
  main {
    padding: 22px 15px;
  }
  .page-heading {
    align-items: flex-start;
  }
  h1 {
    font-size: 27px;
  }
  .cards {
    gap: 10px;
  }
  .card {
    padding: 16px;
  }
  .card .value {
    font-size: 23px;
  }
  .panel {
    padding: 17px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .big-banner {
    display: block;
  }
  .connection {
    align-items: flex-start;
    flex-direction: column;
  }
  #filters input[type="date"] {
    flex: 1;
    width: 120px;
  }
  footer {
    padding: 20px 15px;
  }
}
@media print {
  aside,
  header,
  #filters,
  .notice,
  #actions,
  button,
  footer {
    display: none !important;
  }
  .shell {
    margin: 0;
  }
  main {
    padding: 0;
  }
  .panel,
  .card {
    break-inside: avoid;
  }
  .print-head {
    display: block;
  }
  body {
    background: white;
  }
  .cards {
    grid-template-columns: repeat(4, 1fr);
  }
  .card:first-child {
    color: var(--ink);
    background: white;
    border: 1px solid var(--line);
  }
}

/* ===== Acesso (modo nuvem) ===== */
body.auth-mode aside,
body.auth-mode .shell { display: none; }
#auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: #102c32; }
#auth[hidden] { display: none; }
.auth-card { background: #fff; border-radius: 16px; padding: 32px 28px; width: 100%; max-width: 400px; }
.auth-card .brand { color: #102c32; margin-bottom: 28px; display: block; }
.auth-card h1 { margin: 0 0 6px; font-size: 26px; }
.auth-card form { display: grid; gap: 14px; margin-top: 18px; }
.auth-card label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
.auth-msg { min-height: 20px; color: #8a4b00; font-size: 13px; margin: 0; }
button.link { background: none; border: 0; color: #1d6b5c; padding: 10px 0 0; text-decoration: underline; cursor: pointer; }
