:root {
  --bg-main: #eef3f8;
  --bg-soft: #f7fbff;
  --panel: #ffffff;
  --line: #d8e2ee;
  --ink: #17263a;
  --ink-soft: #617389;
  --brand: #1260d4;
  --brand-deep: #0a4eae;
  --accent-cyan: #11b7ca;
  --accent-amber: #ff9f1c;
  --accent-green: #1e9e62;
  --accent-pink: #e64cb2;
  --radius-lg: 16px;
  --shadow-soft: 0 18px 42px rgba(19, 44, 84, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Nunito Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
  font-family: "Sora", "Nunito Sans", sans-serif;
  letter-spacing: -0.02em;
}

.app-body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(6px);
  pointer-events: none;
  z-index: 0;
}

.orb-a {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle at center, rgba(17, 183, 202, 0.22), rgba(17, 183, 202, 0));
  top: -60px;
  right: -80px;
}

.orb-b {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at center, rgba(18, 96, 212, 0.16), rgba(18, 96, 212, 0));
  bottom: -110px;
  left: -120px;
}

.app-shell {
  position: relative;
  min-height: 100vh;
}

.sidebar {
  width: 264px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 1rem 0.8rem;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1030;
  overflow-y: auto;
  transition: transform 0.28s ease, width 0.28s ease;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent-cyan), var(--brand));
  color: #fff;
  font-weight: 800;
}

.brand-copy strong {
  display: block;
  font-family: "Sora", sans-serif;
  font-size: 1.03rem;
}

.brand-copy small {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.nav-stack .nav-link {
  border-radius: 13px;
  margin-bottom: 0.4rem;
  padding: 0.58rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #214267;
  border: 1px solid transparent;
  font-weight: 700;
}

.nav-stack .nav-link i {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ebf4ff;
  color: var(--brand);
  border: 1px solid #cfe1f8;
}

.nav-stack .nav-link.menu-dashboard i { color: #2563eb; background: #eaf2ff; border-color: #bfdbfe; }
.nav-stack .nav-link.menu-users i { color: #7c3aed; background: #f3e8ff; border-color: #ddd6fe; }
.nav-stack .nav-link.menu-clients i { color: #0d9488; background: #e6fffb; border-color: #b8f3ea; }
.nav-stack .nav-link.menu-equipments i { color: #0284c7; background: #e7f6ff; border-color: #bae6fd; }
.nav-stack .nav-link.menu-tickets i { color: #dc2626; background: #fff1f2; border-color: #fecdd3; }
.nav-stack .nav-link.menu-invoices i { color: #15803d; background: #ecfdf3; border-color: #bbf7d0; }
.nav-stack .nav-link.menu-repairs i { color: #b45309; background: #fff7ed; border-color: #fed7aa; }
.nav-stack .nav-link.menu-settings i { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }

.nav-stack .nav-link:hover {
  background: #f4f9ff;
  border-color: #c8dbf2;
}

.nav-stack .nav-link.active {
  background: #e9f3ff;
  border-color: #9fc0ea;
  color: var(--brand-deep);
}

.main-content {
  margin-left: 264px;
  padding: 1rem;
  transition: margin-left 0.28s ease;
}

.topbar {
  border-radius: var(--radius-lg);
  background: linear-gradient(110deg, #13bfd4, #1260d4);
  padding: 0.9rem 1rem;
  color: #fff;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.title-hero {
  font-size: 1.12rem;
  color: #fff;
}

.subtitle-hero {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.pill-info {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  padding: 0.3rem 0.68rem;
  font-size: 0.79rem;
  background: rgba(255, 255, 255, 0.18);
}

.icon-btn {
  border-radius: 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1rem;
}

.panel h2 {
  font-size: 1.03rem;
  margin-bottom: 0.9rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.clients-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.clients-search {
  flex: 1 1 420px;
  max-width: 620px;
}

.equipments-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.equipments-search {
  flex: 1 1 560px;
  max-width: 840px;
}

.equipments-search .input-group {
  flex-wrap: wrap;
  gap: 0.35rem;
}

.equipments-client-filter {
  max-width: 260px;
  min-width: 220px;
}

.clients-metrics {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.clients-metric {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  border: 1px solid #cde0f5;
  background: #eef6ff;
  color: #355677;
  padding: 0.33rem 0.66rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.clients-metric strong {
  color: #fff;
  background: #0d6efd;
  border-radius: 999px;
  padding: 0.06rem 0.42rem;
  min-width: 1.6rem;
  text-align: center;
}

.clients-metric.ok strong {
  background: #0f9f5f;
}

.clients-metric.off strong {
  background: #d93f3f;
}

.clients-status-switch {
  display: inline-flex;
  align-items: center;
}

.clients-status-switch .form-check-input {
  width: 2.35rem;
  height: 1.18rem;
  margin-top: 0;
  cursor: pointer;
}

.btn-qr-inline {
  white-space: nowrap;
}

.kpi-card {
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
  border: 1px solid #d9e5f4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 96px;
  box-shadow: var(--shadow-soft);
  background: #fff;
}

.kpi-card small {
  color: #59738e;
  font-weight: 700;
}

.kpi-card h3 {
  margin: 0.18rem 0 0 0;
  font-size: 1.42rem;
}

.kpi-card i {
  font-size: 1.45rem;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
}

.kpi-cyan i {
  color: #087887;
  background: #ddf9fc;
}

.kpi-blue i {
  color: #0a4eae;
  background: #e4efff;
}

.kpi-amber i {
  color: #9f5f00;
  background: #fff2dc;
}

.kpi-green i {
  color: #0f6d43;
  background: #ddf5e9;
}

.table-clean > :not(caption) > * > * {
  border-bottom-color: #e7edf4;
  padding: 0.78rem 0.64rem;
}

.table-clean thead th {
  color: #698096;
  font-weight: 800;
  font-size: 0.86rem;
  white-space: nowrap;
}

.table-clean tbody td {
  font-size: 0.93rem;
}

.table-clean a {
  font-weight: 700;
  text-decoration-thickness: 2px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.58rem;
  border: 1px solid transparent;
}

.status-chip.waiting {
  color: #915800;
  background: #fff2df;
  border-color: #ffd6a0;
}

.status-chip.route {
  color: #0b4a8f;
  background: #e6f1ff;
  border-color: #bad5f5;
}

.status-chip.progressx {
  color: #056f74;
  background: #ddfbff;
  border-color: #aaeef4;
}

.status-chip.done {
  color: #0f6d43;
  background: #ddf8e9;
  border-color: #b8edce;
}

.timeline-lite {
  position: relative;
  padding-left: 1.2rem;
}

.timeline-lite::before {
  content: "";
  position: absolute;
  left: 0.34rem;
  top: 0.18rem;
  bottom: 0.18rem;
  width: 2px;
  background: #d9e8f8;
}

.tl-item {
  position: relative;
  margin-bottom: 1rem;
}

.tl-item:last-child {
  margin-bottom: 0;
}

.tl-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  position: absolute;
  left: -1.2rem;
  top: 0.18rem;
  border: 2px solid #fff;
}

.tl-dot.ok {
  background: #12b7c9;
}

.tl-dot.pause {
  background: #e64cb2;
}

.tl-dot.gray {
  background: #99aab8;
}

.tl-content strong {
  display: block;
  font-size: 0.93rem;
}

.tl-content p {
  margin: 0;
  color: #5f7387;
  font-size: 0.86rem;
}

.agenda-card {
  border: 1px solid #dce8f4;
  border-radius: 14px;
  display: flex;
  overflow: hidden;
  margin-bottom: 0.62rem;
}

.agenda-card:last-child {
  margin-bottom: 0;
}

.left-bar {
  width: 6px;
}

.left-bar.blue {
  background: #2486f4;
}

.left-bar.pink {
  background: #e64cb2;
}

.left-bar.gray {
  background: #95a5b2;
}

.left-bar.red {
  background: #c82535;
}

.agenda-main {
  padding: 0.66rem 0.76rem;
  width: 100%;
}

.agenda-main header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.agenda-main p {
  margin: 0.17rem 0 0.45rem;
  color: #61758d;
}

.chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chips span {
  border: 1px solid #d7e2ef;
  border-radius: 10px;
  padding: 0.14rem 0.48rem;
  font-size: 0.78rem;
  background: #fff;
}

.dot-chip::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.35rem;
}

.dot-chip.route::before {
  background: #1c67d3;
}

.dot-chip.pause::before {
  background: #e64cb2;
}

.dot-chip.done::before {
  background: #8fa2b0;
}

.dot-chip.progressx::before {
  background: #06b6d4;
}

.dot-chip.waiting::before {
  background: #ff9f1c;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.62rem;
}

.grid-form .form-label {
  display: block;
  margin-bottom: 0.32rem;
  color: #2b435e;
  font-weight: 600;
}

.field-hint {
  margin-top: 0.28rem;
  color: #70849a;
  font-size: 0.78rem;
  line-height: 1.25;
}

.chamados-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 0.62rem;
}

.chamados-stack {
  display: grid;
  gap: 0.62rem;
}

.ticket-card {
  border: 1px solid #dce8f4;
  border-radius: 14px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  background: #fff;
}

.ticket-main {
  flex: 1;
  padding: 0.7rem 0.8rem;
}

.ticket-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.ticket-top h3 {
  margin: 0;
  font-size: 1rem;
}

.ticket-top p {
  margin: 0.17rem 0 0.55rem;
  color: #5f7387;
  font-size: 0.9rem;
}

.ticket-top time {
  font-size: 1.05rem;
  color: #233b53;
  font-weight: 700;
  white-space: nowrap;
}

.ticket-go {
  border: 0;
  border-left: 1px solid #e3ebf5;
  width: 54px;
  background: #fbfdff;
  color: #7a8ea4;
  font-size: 1.2rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.ticket-go:hover {
  background: #f1f7ff;
  color: #1867d2;
}

.status-lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.6rem;
}

.lane {
  border-radius: 14px;
  padding: 0.7rem;
  border: 1px solid;
}

.lane h3 {
  margin: 0;
  font-size: 0.95rem;
}

.lane p {
  margin: 0.2rem 0 0;
  color: #54687f;
  font-size: 0.84rem;
}

.lane-sky {
  background: #e6f6ff;
  border-color: #c3e8ff;
}

.lane-amber {
  background: #fff4e5;
  border-color: #ffdca9;
}

.lane-pink {
  background: #ffe9f8;
  border-color: #f7c3e7;
}

.lane-teal {
  background: #e5fbf6;
  border-color: #bff3e6;
}

.dot-legend {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-legend.pink {
  background: #e64cb2;
}

.dot-legend.amber {
  background: #ff9f1c;
}

.dot-legend.teal {
  background: #11b7ca;
}

.metric-list {
  list-style: none;
  margin: 0 0 1rem 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.metric-list li {
  border: 1px solid #d9e6f3;
  border-radius: 12px;
  padding: 0.45rem 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-list span {
  color: #5f758a;
}

.permissions-box {
  border: 1px solid #d8e4f2;
  border-radius: 12px;
  padding: 0.7rem;
  background: #f8fbff;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  max-height: 340px;
  overflow-y: auto;
}

.perm-chip {
  border: 1px solid #ccdae9;
  border-radius: 999px;
  padding: 0.2rem 0.52rem;
  display: inline-flex;
  align-items: center;
  gap: 0.33rem;
  background: #fff;
  font-size: 0.82rem;
  color: #2d4259;
}

.perm-chip input[type="checkbox"] {
  margin: 0;
}

.qr-mini {
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 4px;
  box-shadow: 0 0 0 1px #d2deea;
  background:
    linear-gradient(90deg, #21374f 14%, transparent 14%, transparent 29%, #21374f 29%, #21374f 44%, transparent 44%, transparent 59%, #21374f 59%, #21374f 73%, transparent 73%),
    linear-gradient(0deg, #21374f 14%, transparent 14%, transparent 29%, #21374f 29%, #21374f 44%, transparent 44%, transparent 59%, #21374f 59%, #21374f 73%, transparent 73%),
    #fff;
}

.qr-preview-wrap {
  min-height: 250px;
  border: 1px dashed #d6e2f0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #f8fbff;
  padding: 0.8rem;
}

.qr-preview-wrap canvas {
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16, 42, 67, 0.12);
  background: #fff;
}

.qr-preview-wrap img {
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16, 42, 67, 0.12);
  background: #fff;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 27, 49, 0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: 0.25s;
  z-index: 1000;
}

.app-shell.mobile-open .overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Garante que modais sempre fiquem acima da sidebar/topbar */
.modal-backdrop {
  z-index: 2090 !important;
}

.modal {
  z-index: 2100 !important;
}

.modal-content {
  pointer-events: auto;
}

body.modal-open .overlay {
  pointer-events: none !important;
}

.app-shell.sidebar-collapsed .sidebar {
  width: 86px;
}

.app-shell.sidebar-collapsed .main-content {
  margin-left: 86px;
}

.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .nav-link span {
  display: none;
}

.app-shell.sidebar-collapsed .nav-stack .nav-link {
  justify-content: center;
}

.app-shell.sidebar-collapsed .brand-wrap {
  justify-content: center;
}

.reveal-step {
  animation: riseIn 0.45s ease both;
}

.reveal-step.d2 {
  animation-delay: 0.08s;
}

.reveal-step.d3 {
  animation-delay: 0.16s;
}

.reveal-step.d4 {
  animation-delay: 0.24s;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-body {
  background:
    radial-gradient(circle at 8% 12%, rgba(17, 183, 202, 0.24), transparent 40%),
    radial-gradient(circle at 92% 88%, rgba(18, 96, 212, 0.18), transparent 45%),
    #f4f8fd;
}

.badge-soft {
  display: inline-flex;
  border: 1px solid #b7d5f5;
  color: #0f539d;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  background: #e7f3ff;
  font-size: 0.79rem;
  font-weight: 800;
}

.login-showcase {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.showcase-head h1 {
  max-width: 780px;
  margin: 0.64rem 0 0.4rem;
  font-size: clamp(1.6rem, 2.2vw, 2.15rem);
}

.showcase-head p {
  margin: 0;
  color: #52697f;
  max-width: 620px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.7rem;
}

.preview-card {
  border-radius: 16px;
  border: 1px solid #d6e3f2;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(2px);
  padding: 0.8rem;
}

.preview-card h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}

.preview-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.preview-card li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed #d8e3f0;
  padding: 0.25rem 0;
}

.preview-card li:last-child {
  border-bottom: 0;
}

.preview-card strong {
  color: #0f5199;
}

.auth-card {
  max-width: 450px;
  background: #fff;
  border: 1px solid #d7e3f1;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 1.15rem;
}

.auth-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.auth-card p {
  color: #61778d;
}

.auth-foot {
  border-top: 1px solid #e4ecf5;
  padding-top: 0.72rem;
  margin-top: 0.78rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: #60758d;
}

.portal-body {
  background: #edf3fb;
}

.portal-top {
  background: #fff;
  border-bottom: 1px solid #d6e2f0;
  padding: 0.78rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.portal-top h1 {
  margin: 0;
  font-size: 1.1rem;
}

.portal-top p {
  color: #5f758b;
  font-size: 0.88rem;
}

.timeline-lite.compact .tl-content p {
  font-size: 0.82rem;
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-102%);
    z-index: 1200;
  }

  .main-content {
    margin-left: 0;
  }

  .app-shell.mobile-open .sidebar {
    transform: translateX(0);
  }

  .topbar {
    border-radius: 14px;
  }
}

@media (max-width: 767.98px) {
  .chamados-toolbar {
    grid-template-columns: 1fr;
  }

  .ticket-top {
    flex-direction: column;
    gap: 0.2rem;
  }

  .ticket-top time {
    font-size: 0.95rem;
  }

  .ticket-go {
    width: 44px;
  }

  .title-hero {
    font-size: 1rem;
  }

  .subtitle-hero {
    font-size: 0.79rem;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
