:root {
  --blue: #0789e8;
  --light: #e8f3fd;
  --ink: #142238;
  --muted: #637387;
  --green: #087e51;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: linear-gradient(145deg, #f5faff, #e6f2fc);
  font:
    16px system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  min-height: 100vh;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid #78baf0;
  outline-offset: 2px;
}
.hidden {
  display: none !important;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #539fe0;
  font-size: 26px;
  font-weight: 850;
  letter-spacing: -1px;
}
.brand svg {
  width: 48px;
  height: 48px;
  flex: none;
}
.icon {
  width: 23px;
  height: 23px;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #e5eef7;
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 5px 20px #3976ad0c;
}
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login .card {
  width: min(440px, 100%);
  padding: 32px;
}
.muted,
small {
  color: var(--muted);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 27px;
}
h2 {
  font-size: 21px;
}
h3 {
  font-size: 17px;
}
p {
  line-height: 1.5;
}
label {
  display: block;
  font-weight: 650;
  margin: 15px 0 6px;
}
input,
select {
  width: 100%;
  border: 1px solid #d7e4f0;
  border-radius: 12px;
  padding: 12px;
  background: white;
  color: var(--ink);
}
.btn {
  border: 0;
  border-radius: 13px;
  padding: 12px 16px;
  background: var(--light);
  color: #086cb9;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.primary {
  background: var(--blue);
  color: white;
}
.wide {
  width: 100%;
}
.top {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: #f8fbff;
  border-bottom: 1px solid #dfeaf5;
  position: sticky;
  top: 0;
  z-index: 500;
}
.top-actions {
  display: flex;
  gap: 12px;
}
.iconbtn {
  border: 0;
  background: #e8f3fd;
  color: var(--blue);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
}
.shell {
  display: grid;
  grid-template-columns: 225px minmax(0, 1fr);
  max-width: 1600px;
  margin: auto;
}
.nav {
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  border-right: 1px solid #dfeaf5;
}
.nav button,
.tabs button {
  border: 0;
  background: transparent;
  color: #526174;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  font-weight: 650;
}
.nav button.active,
.tabs button.active {
  background: var(--blue);
  color: white;
}
.main {
  padding: 26px;
  min-width: 0;
  max-width: 1250px;
  width: 100%;
  margin: auto;
}
.stack {
  display: grid;
  gap: 16px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.between {
  justify-content: space-between;
}
.back {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 30px;
  background: #dcf8e8;
  color: var(--green);
  font-size: 14px;
  font-weight: 750;
  padding: 5px 12px;
}
.pill:before {
  content: "";
  width: 9px;
  height: 9px;
  background: #18c76a;
  border-radius: 50%;
}
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  background: #fff;
  border-radius: 19px;
  padding: 5px;
  box-shadow: 0 4px 16px #3976ad10;
}
.tabs button {
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 12px 4px;
  font-size: 14px;
}
.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: start;
}
.map {
  height: 390px;
  border-radius: 16px;
  background: #e7edf3;
  margin: 15px 0;
  z-index: 1;
  overflow: hidden;
}
.actions,
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.action {
  min-height: 86px;
  justify-content: flex-start;
  text-align: left;
}
.stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}
.stat .icon {
  color: var(--blue);
  width: 29px;
  height: 29px;
  flex: none;
}
.bar {
  height: 12px;
  background: #e5eaf0;
  border-radius: 20px;
  overflow: hidden;
  flex: 1;
}
.bar span {
  display: block;
  height: 100%;
  width: 78%;
  background: #08bf83;
  border-radius: 20px;
}
.notice {
  font-size: 13px;
  color: #52677e;
  background: #edf6ff;
  border-radius: 12px;
  padding: 10px 14px;
}
.list {
  display: grid;
  gap: 10px;
}
.event {
  padding: 13px 0;
  border-bottom: 1px solid #e5edf5;
}
.event:last-child {
  border: 0;
}
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: calc(100% - 48px);
  background: #142238;
  color: white;
  padding: 15px;
  border-radius: 13px;
  z-index: 1000;
}
.devicecard {
  max-width: 650px;
}
.formgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
}
.check input {
  width: auto;
}
.danger {
  color: #a52d3b;
  background: #fff0f2;
}
a {
  color: #0877c9;
}
.sectiongap {
  margin-top: 12px;
}
@media (max-width: 850px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .nav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    z-index: 500;
    background: #f8fbff;
    border: 0;
    border-top: 1px solid #dfeaf5;
    flex-direction: row;
    justify-content: space-around;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    gap: 2px;
  }
  .nav button {
    flex: 1;
    flex-direction: column;
    gap: 4px;
    padding: 7px 2px;
    font-size: 11px;
  }
  .nav button.active {
    background: transparent;
    color: var(--blue);
  }
  .main {
    padding: 16px 12px 100px;
  }
  .top {
    height: 66px;
    padding: 0 15px;
  }
  .brand {
    font-size: 23px;
  }
  .brand svg {
    width: 39px;
    height: 39px;
  }
  .detail {
    grid-template-columns: 1fr;
  }
  .map {
    height: 270px;
  }
  .card {
    padding: 16px;
  }
  .tabs button {
    font-size: 12px;
  }
  .action {
    min-height: 72px;
    font-size: 14px;
  }
  .stat {
    padding: 12px;
    gap: 8px;
  }
  .stat h3 {
    font-size: 14px;
  }
  .pill {
    font-size: 12px;
    padding: 5px 8px;
  }
  .toast {
    bottom: 90px;
  }
  .formgrid {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 23px;
  }
}
@media (min-width: 600px) and (max-width: 850px) {
  .map {
    height: 360px;
  }
  .main {
    padding: 24px 24px 100px;
  }
}

body.dark {
  --ink: #e7effa;
  --muted: #a9bed4;
  --light: #233d58;
  --blue: #168fea;
  --green: #8aebbc;
  background: #101e30;
  color: var(--ink);
}
body.dark .card,
body.dark .tabs,
body.dark .top,
body.dark .nav {
  background: #192c43;
  border-color: #30465e;
}
body.dark input,
body.dark select {
  background: #102238;
  border-color: #405872;
  color: var(--ink);
}
body.dark .btn:not(.primary) {
  color: #b4ddff;
}
body.dark .nav button,
body.dark .tabs button {
  color: #b7cbe0;
}
body.dark .nav button.active,
body.dark .tabs button.active {
  color: white;
}
body.dark .notice {
  background: #233d58;
  color: #c5d8eb;
}
body.dark .pill {
  background: #204b3e;
}
body.dark .event {
  border-color: #30465e;
}
body.dark .iconbtn {
  background: #233d58;
  color: #8acaff;
}
body.dark .danger {
  background: #532d3b;
  color: #ffc5ce;
}
.devicegrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 16px;
}
.abouthero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}
.abouthero img {
  width: 100%;
  border-radius: 20px;
}
.devicecard {
  max-width: none;
}
.settingsgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.nav button {
  white-space: nowrap;
}
@media (max-width: 850px) {
  .settingsgrid,
  .abouthero {
    grid-template-columns: 1fr;
  }
  .nav button {
    white-space: normal;
  }
  .abouthero img {
    max-width: 360px;
    margin: auto;
  }
}


/* ========================================
   INTERFACE DE AUTENTICAÇÃO
   ======================================== */

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);

    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    border: none;
    background: transparent;
    color: var(--muted);

    cursor: pointer;
}

.password-toggle svg {
    width: 21px;
    height: 21px;
}

.password-requirements {
    margin-top: 12px;
    padding: 14px;

    background: var(--light);
    border-radius: 12px;

    font-size: 13px;
    color: var(--muted);
}

.password-requirements strong {
    display: block;
    margin-bottom: 8px;
}

.password-requirements p {
    margin: 5px 0;
    transition: color 0.2s;
}

.password-requirements p.valid {
    color: var(--green);
    font-weight: 600;
}
