/* =============================================
   VORTEX NOC ��,��?� DESIGN SYSTEM
   ============================================= */

:root {
  --bg: #0a0d14;
  --bg2: #0f1320;
  --bg3: #151c2e;
  --surface: #1a2236;
  --surface2: #1f2a40;
  --border: rgba(255, 255, 255, 0.07);
  --border2: rgba(255, 255, 255, 0.12);
  --primary: #00c6ff;
  --primary-grad: linear-gradient(135deg, #00c6ff, #9b59f7);
  --text: #e8edf5;
  --text2: #8a96a8;
  --text3: #5a6375;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --font: 'Inter', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.screen {
  display: none;
  min-height: 100vh;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

.hidden {
  display: none !important;
}

/* ��?��,���?��,� LOGIN ��?��,���?��,� */
#login-screen {
  align-items: center;
  justify-content: center;
  position: relative;
}

.login-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.login-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 198, 255, 0.15) 0%, transparent 70%);
  top: -200px;
  left: -200px;
  animation: floatBlob 10s ease-in-out infinite alternate;
}

.login-glow.glow-2 {
  background: radial-gradient(circle, rgba(155, 89, 247, 0.15) 0%, transparent 70%);
  bottom: -200px;
  right: -150px;
  top: auto;
  left: auto;
  animation-delay: -5s;
}

@keyframes floatBlob {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(60px, 40px) scale(1.1);
  }
}

.login-card {
  position: relative;
  z-index: 1;
  background: rgba(26, 34, 54, 0.75);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border2);
  border-radius: 24px;
  padding: 44px 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.login-brand {
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--primary-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.login-subtitle {
  font-size: 0.78rem;
  color: var(--text2);
}

.login-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-desc {
  color: var(--text2);
  font-size: 0.88rem;
  margin-bottom: 28px;
}

.login-error {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.35);
  border-radius: var(--radius-sm);
  color: #ff6b6b;
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.login-hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text3);
  margin-top: 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

/* �"?�"? FORMS �"?�"? */
.form-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  padding: 4px 0 8px;
  margin-top: 4px;
  border-bottom: 1px solid var(--border2);
  margin-bottom: 14px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text3);
  display: flex;
  align-items: center;
}

.input-wrap input {
  padding-left: 40px !important;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
input:not([type]),
select,
textarea,
button.field-input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: rgba(0, 198, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(0, 198, 255, 0.12);
}

select {
  appearance: none;
  cursor: pointer;
  color-scheme: dark;
}

select option,
select optgroup {
  background: var(--surface);
  color: var(--text);
}

select optgroup {
  font-style: normal;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text2);
  background: var(--bg3);
}

textarea {
  resize: vertical;
}

/* ��?��,���?��,� BUTTONS ��?��,���?��,� */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px 20px;
  background: var(--primary-grad);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 18px rgba(0, 198, 255, 0.25);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary.btn-sm {
  width: auto;
  padding: 8px 16px;
  font-size: 0.82rem;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.btn-secondary.icon-only {
  padding: 8px 10px;
}

@keyframes spin-refresh {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.btn-secondary.icon-only.spinning svg {
  animation: spin-refresh 0.6s linear;
}

/* ��?��,���?��,� TOPBAR (admin) ��?��,���?��,� */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  background: rgba(15, 19, 32, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--primary-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-title {
  font-size: 0.82rem;
  color: var(--text2);
  padding-left: 20px;
  border-left: 1px solid var(--border2);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.search-wrap svg {
  color: var(--text3);
  flex-shrink: 0;
}

.search-wrap input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  width: 160px;
  padding: 0;
  box-shadow: none;
}

.search-wrap input::placeholder {
  color: var(--text3);
}

.filter-select {
  padding: 7px 30px 7px 12px;
  background: rgba(255, 255, 255, 0.05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a96a8' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
  outline: none;
  width: 160px;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.avatar.sm {
  width: 26px;
  height: 26px;
  font-size: 0.72rem;
}

.avatar-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}

.avatar-menu:hover {
  background: rgba(255, 255, 255, 0.05);
}

.avatar-menu span {
  font-size: 0.85rem;
  font-weight: 500;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  width: 160px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 200;
  animation: fadeDown 0.18s ease;
}

.user-dropdown.open {
  display: block;
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  font-size: 0.85rem;
  color: var(--text2);
  cursor: pointer;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

/* ��?��,���?��,� STATS BAR ��?��,���?��,� */
.stats-bar {
  display: flex;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  overflow-x: auto;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.12s, box-shadow 0.18s;
  user-select: none;
}

.stat-card:hover {
  border-color: var(--border2);
  background: var(--surface2);
  transform: translateY(-1px);
}

.stat-card.active {
  border-color: var(--stat-active-color, var(--primary));
  background: color-mix(in srgb, var(--stat-active-color, var(--primary)) 12%, var(--surface));
  box-shadow: 0 0 0 1px var(--stat-active-color, var(--primary)) inset;
}

.stat-card.active .stat-label {
  color: var(--text);
}

.stat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text2);
}

.stat-count {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-left: 8px;
}

/* ��?��,���?��,� KANBAN (admin) ��?��,���?��,� */
.kanban-board {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  align-items: flex-start;
}

.kanban-board::-webkit-scrollbar {
  height: 6px;
}

.kanban-board::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 3px;
}

.kanban-col {
  flex-shrink: 0;
  width: 280px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  /* Cresce com o conteudo ate o teto do viewport. Entao col-cards scroll. */
  max-height: calc(100vh - 172px);
  transition: border-color 0.2s;
}

.kanban-col.drag-over {
  border-color: var(--primary);
  background: rgba(0, 198, 255, 0.04);
}

.col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.col-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.col-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.col-title {
  font-size: 0.85rem;
  font-weight: 700;
}

.col-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text3);
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 7px;
  border-radius: 20px;
}

.col-cards {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* min-height: 0 garante que o scroll funcione dentro do flexbox */
  min-height: 0;
  scroll-behavior: smooth;
}

.col-cards::-webkit-scrollbar {
  width: 4px;
}

.col-cards::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 2px;
  opacity: 0.6;
}

/* Anima��o suave para card novo via realtime (sem flicker) */
@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Pulso suave para card atualizado via realtime */
@keyframes cardPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 198, 255, 0.35);
  }

  60% {
    box-shadow: 0 0 0 6px rgba(0, 198, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(0, 198, 255, 0);
  }
}

.os-card.rt-new {
  animation: cardSlideIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.os-card.rt-updated {
  animation: cardPulse 0.6s ease;
}

.os-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  cursor: grab;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.2s;
  animation: cardIn 0.25s ease;
  position: relative;
  overflow: hidden;
  /* Impede que o card comprima dentro do flex container �?" ativa scroll em vez disso */
  flex-shrink: 0;
}

.os-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  border-radius: 2px 0 0 2px;
}

.os-card.priority-normal::before {
  background: #3b8fd4;
}

.os-card.priority-high::before {
  background: #f39c12;
}

.os-card.priority-urgent::before {
  background: #e74c3c;
}

.os-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border-color: var(--border2);
}

.os-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.05em;
}

.card-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-tipo {
  background: rgba(0, 198, 255, 0.15);
  color: #00c6ff;
}

.badge-urgent {
  background: rgba(231, 76, 60, 0.18);
  color: #ff6b6b;
}

.badge-high {
  background: rgba(243, 156, 18, 0.18);
  color: #f0b429;
}

.badge-pri {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-pri svg {
  flex-shrink: 0;
}

.badge-pri-urgent {
  background: rgba(231, 76, 60, 0.18);
  color: #ff6b6b;
}

.badge-pri-high {
  background: rgba(243, 156, 18, 0.18);
  color: #f0b429;
}

.badge-conexao {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}

.badge-offline {
  background: rgba(231, 76, 60, 0.18);
  color: #e74c3c;
}

.badge-online {
  background: rgba(0, 198, 160, 0.18);
  color: #00c6a0;
}

.badge-conexao-nd {
  background: rgba(138, 150, 168, 0.15);
  color: #8a96a8;
}

.card-client {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-address {
  font-size: 0.78rem;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 10px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-tech {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text2);
}

.card-tech-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.card-date {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text3);
}

.card-btn-detail {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.os-card:hover .card-btn-detail {
  opacity: 1;
}

.col-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px;
  text-align: center;
  color: var(--text3);
  font-size: 0.8rem;
  opacity: 0.7;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =============================================
   MOBILE TECH SCREEN
   ============================================= */
.tech-mobile {
  background: var(--bg);
  max-width: 480px;
  margin: 0 auto;
}

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 13, 20, 0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0 0;
}

.mobile-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 18px;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 800;
  background: var(--primary-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mobile-user-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  position: relative;
  transition: background 0.2s;
}

.mobile-user-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.mobile-user-btn span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text2);
}

.mobile-user-btn svg {
  color: var(--text3);
}

.mobile-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 10px;
  padding: 0 18px;
}

.mobile-stats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 18px 14px;
}

.mobile-stats::-webkit-scrollbar {
  display: none;
}

.mstat {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, outline 0.15s;
  user-select: none;
}

.mstat:active {
  opacity: 0.75;
}

.mstat-active {
  background: rgba(255, 255, 255, 0.12);
  border-color: transparent;
}

.mstat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.mstat span {
  font-size: 0.72rem;
  color: var(--text2);
}

.mstat strong {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.mobile-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 80px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Priority Group Header */
.m-group-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 2px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.m-group-header:first-child {
  margin-top: 0;
}

.m-group-count {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text3);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
}

.m-group-urgent {
  color: #ff6b6b;
}

.m-group-urgent svg {
  stroke: #ff6b6b;
}

.m-group-high {
  color: #f0b429;
}

.m-group-high svg {
  stroke: #f0b429;
}

.m-group-normal {
  color: var(--text2);
}

.m-group-normal svg {
  stroke: var(--text2);
}

/* Mobile Card */
.m-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s, opacity 0.3s;
  animation: cardIn 0.22s ease;
}

.m-card.status-concluido {
  opacity: 0.6;
}

.m-card.status-cancelado {
  opacity: 0.45;
}

.m-card-accent {
  height: 4px;
  width: 100%;
}

.m-accent-urgent {
  background: linear-gradient(90deg, #e74c3c, #ff6b6b);
}

.m-accent-high {
  background: linear-gradient(90deg, #f39c12, #f0b429);
}

.m-accent-normal {
  background: linear-gradient(90deg, #3b8fd4, #00c6ff);
}

.m-card-body {
  padding: 14px 16px 12px;
}

.m-card-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.m-card-id {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
}

.m-card-badges {
  display: flex;
  gap: 4px;
}

.m-card-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 5px;
  line-height: 1.25;
}

.m-card-address {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--text2);
  margin-bottom: 10px;
  line-height: 1.4;
}

.m-card-address svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.m-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.m-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  color: var(--text3);
}

/* Action row */
.m-card-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
}

.btn-execute {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 14px;
  background: rgba(155, 89, 247, 0.1);
  border: 1px solid rgba(155, 89, 247, 0.35);
  border-radius: var(--radius-sm);
  color: #9b59f7;
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
}

.btn-execute:hover {
  background: rgba(155, 89, 247, 0.2);
}

.btn-execute:active {
  transform: scale(0.97);
}

.btn-finish-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 14px;
  background: rgba(0, 198, 160, 0.1);
  border: 1px solid rgba(0, 198, 160, 0.35);
  border-radius: var(--radius-sm);
  color: #00c6a0;
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
}

.btn-finish-action:hover {
  background: rgba(0, 198, 160, 0.2);
}

.btn-finish-action:active {
  transform: scale(0.97);
}

/* Done/cancelled footer */
.m-card-done-row {
  padding: 8px 16px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text3);
  border-top: 1px solid var(--border);
}

.m-card-done-row svg {
  flex-shrink: 0;
}

.m-card-photo-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  border: 1px solid var(--border2);
  margin-left: auto;
  flex-shrink: 0;
  cursor: pointer;
}

.m-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 20px;
  text-align: center;
  color: var(--text3);
  font-size: 0.88rem;
}

.m-empty svg {
  opacity: 0.3;
}

/* Section separator between active and finalized OS */
.m-section-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  color: var(--text3);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.m-section-sep::before,
.m-section-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ��?��,���?��,� STATUS CHIPS ��?��,���?��,� */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 20px;
}

.chip-backlog {
  background: rgba(59, 143, 212, 0.15);
  color: #3b8fd4;
}

.chip-agendado {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.chip-andamento {
  background: rgba(155, 89, 247, 0.18);
  color: #9b59f7;
}

.chip-concluido {
  background: rgba(0, 198, 160, 0.15);
  color: #00c6a0;
}

.chip-cancelado {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.status-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-backlog {
  background: rgba(59, 143, 212, 0.2);
  color: #3b8fd4;
}

.status-agendado {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
}

.status-andamento {
  background: rgba(155, 89, 247, 0.2);
  color: #9b59f7;
}

.status-concluido {
  background: rgba(0, 198, 160, 0.2);
  color: #00c6a0;
}

.status-cancelado {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}

.pill-normal {
  background: rgba(59, 143, 212, 0.15);
  color: #3b8fd4;
}

.pill-high {
  background: rgba(243, 156, 18, 0.18);
  color: #f0b429;
}

.pill-urgent {
  background: rgba(231, 76, 60, 0.18);
  color: #ff6b6b;
}

/* ��?��,���?��,� MODALS ��?��,���?��,� */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeOverlay 0.2s ease;
}

@keyframes fadeOverlay {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-overlay.hidden {
  display: none;
}

/* �"?�"? MULTI-SELECT �"?�"? */
.ms-wrap {
  position: relative;
  user-select: none;
}

.ms-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text);
  min-height: 40px;
  gap: 8px;
}

.ms-trigger:hover {
  border-color: var(--accent);
}

.ms-trigger.open {
  border-color: var(--accent);
}

.ms-display {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ms-display.placeholder {
  color: var(--text3);
}

.ms-chevron {
  flex-shrink: 0;
  transition: transform .2s;
}

.ms-trigger.open .ms-chevron {
  transform: rotate(180deg);
}

.ms-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  max-height: 220px;
  overflow-y: auto;
  display: none;
}

.ms-panel.open {
  display: block;
}

.ms-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background .15s;
}

.ms-option:hover {
  background: var(--surface3);
}

.ms-option input[type=checkbox] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.ms-option.ms-all {
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: modalSlide 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-wide {
  max-width: 600px;
}

.modal-finish-card {
  max-width: 460px;
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.07);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.detail-tipo-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  margin-top: 4px;
  background: rgba(0, 198, 255, 0.15);
  color: var(--primary);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.detail-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
}

.detail-field span:last-child {
  font-size: 0.88rem;
  font-weight: 500;
}

.detail-obs {
  padding: 12px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.detail-obs p {
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.6;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-btn {
  flex: 1;
  min-width: 110px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text2);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: var(--primary);
}

.action-btn-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(0, 198, 255, 0.08);
  border-color: rgba(0, 198, 255, 0.35);
  color: var(--primary);
  font-weight: 700;
  width: 100%;
  flex: none;
}

.action-btn-edit:hover {
  background: rgba(0, 198, 255, 0.18);
  border-color: var(--primary);
  color: var(--primary);
}

.action-btn-linked {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(123, 143, 255, 0.08);
  border-color: rgba(123, 143, 255, 0.35);
  color: #7b8fff;
  font-weight: 600;
  width: 100%;
  flex: none;
}

.action-btn-linked:hover {
  background: rgba(123, 143, 255, 0.18);
  border-color: #7b8fff;
}

.btn-os-vinculada {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 4px 10px 6px;
  padding: 4px 10px;
  background: rgba(123, 143, 255, 0.1);
  border: 1px solid rgba(123, 143, 255, 0.3);
  border-radius: 6px;
  color: #7b8fff;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-os-vinculada:hover {
  background: rgba(123, 143, 255, 0.2);
}

/* ��?��,���?��,� FINISH MODAL ��?��,���?��,� */
.finish-info {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.6;
}



.photo-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.required-badge {
  background: rgba(231, 76, 60, 0.2);
  color: #ff6b6b;
  font-size: 0.62rem;
  padding: 1px 6px;
  border-radius: 20px;
  font-weight: 700;
  text-transform: uppercase;
}

.photo-drop-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.photo-drop-zone:hover {
  border-color: var(--primary);
  background: rgba(0, 198, 255, 0.04);
}

.photo-drop-zone.has-photo {
  border-style: solid;
  border-color: rgba(0, 198, 160, 0.5);
}

.photo-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  color: var(--text3);
}

.photo-drop-inner svg {
  opacity: 0.5;
}

.photo-drop-inner p {
  font-size: 0.85rem;
  color: var(--text2);
}

.photo-drop-inner span {
  font-size: 0.72rem;
}

#photo-preview {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.photo-error {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ff6b6b;
  font-size: 0.8rem;
  margin-top: 8px;
}

.btn-finish {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 22px;
  background: linear-gradient(135deg, #00c6a0, #2ecc71);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(0, 198, 160, 0.3);
}

.btn-finish:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* ��?��,���?��,� TOAST ��?��,���?��,� */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow);
  z-index: 300;
  animation: toastIn 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
  white-space: nowrap;
}

.toast.hidden {
  display: none;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.toast.success {
  border-color: rgba(0, 198, 160, 0.5);
  color: #00c6a0;
}

.toast.error {
  border-color: rgba(231, 76, 60, 0.5);
  color: #ff6b6b;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 3px;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ��?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?�
   SIDEBAR + ADMIN LAYOUT
   ��?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?� */
.admin-layout {
  flex-direction: row !important;
  height: 100vh;
  overflow: hidden;
}

/* ��?��,���?��,� SIDEBAR ��?��,���?��,� */
.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: relative;
  /* z-index alto para o dropdown aparecer sobre o admin-layout (overflow:hidden) */
  z-index: 200;
  overflow: visible;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--primary-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 10px 4px;
  margin-bottom: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  position: relative;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.nav-item.active {
  background: rgba(0, 198, 255, 0.12);
  color: var(--primary);
}

.nav-item.active svg {
  stroke: var(--primary);
}

.nav-item-disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.nav-badge-soon {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 700;
  background: rgba(155, 89, 247, 0.2);
  color: #9b59f7;
  padding: 2px 6px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-bottom {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  overflow: visible;
  position: relative;
  z-index: 60;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user-info span:first-child {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.7rem;
  color: var(--text3);
}

/* Sidebar dropdown usa position:fixed para escapar do overflow:hidden do admin-layout */
.sidebar-user .user-dropdown {
  position: fixed;
  bottom: 70px;
  left: 10px;
  top: auto;
  right: auto;
  width: 200px;
  z-index: 500;
}


/* ��?��,���?��,� ADMIN CONTENT ��?��,���?��,� */
.admin-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.admin-view {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* ��?��,���?��,� VIEW TOPBAR ��?��,���?��,� */
.view-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 16px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.view-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.view-subtitle {
  font-size: 0.78rem;
  color: var(--text3);
  margin-top: 2px;
}

/* ��?��,���?��,� KANBAN VIEW ADJUSTMENTS ��?��,���?��,� */
#view-kanban .stats-bar {
  margin: 0;
}

#view-kanban .view-topbar {
  padding: 10px 18px;
  flex-wrap: wrap;
  row-gap: 6px;
}

#view-kanban .topbar-right {
  gap: 6px;
}

#view-kanban .topbar-right .btn-primary {
  white-space: nowrap;
}

/* ��?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?�
   DASHBOARD
   ��?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?� */
/* Dashboard e Ranking podem rolar normalmente */
#view-dashboard,
#view-ranking {
  overflow-y: auto;
  height: 100%;
  min-height: unset;
}

#view-dashboard {
  padding: 0 0 40px;
  gap: 0;
}

/* KPI Grid */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 14px 20px 10px;
}

/* ── Dashboard animations ── */
@keyframes dashFadeUp {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dashShimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

@keyframes donutDraw {
  from {
    stroke-dashoffset: 999;
  }

  to {
    stroke-dashoffset: var(--target-offset);
  }
}

.dash-animate {
  opacity: 0;
  animation: dashFadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Skeleton shimmer nos valores dos KPIs durante o loading */
.kpi-value.kpi-loading {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: dashShimmer 1.2s infinite;
  border-radius: 4px;
  color: transparent !important;
  min-width: 80px;
  display: inline-block;
  height: 1.4em;
}


.kpi-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 0;
}

.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.06;
  border-radius: var(--radius);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.kpi-card.kpi-blue::before {
  background: #00c6ff;
}

.kpi-card.kpi-green::before {
  background: #2ecc71;
}

.kpi-card.kpi-purple::before {
  background: #9b59f7;
}

.kpi-card.kpi-orange::before {
  background: #f39c12;
}

.kpi-card.kpi-red::before {
  background: #ef4444;
}

.kpi-card.kpi-teal::before {
  background: #14b8a6;
}

.kpi-red .kpi-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.kpi-teal .kpi-icon {
  background: rgba(20, 184, 166, 0.15);
  color: #14b8a6;
}

.kpi-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-blue .kpi-icon {
  background: rgba(0, 198, 255, 0.15);
  color: #00c6ff;
}

.kpi-green .kpi-icon {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.kpi-purple .kpi-icon {
  background: rgba(155, 89, 247, 0.15);
  color: #9b59f7;
}

.kpi-orange .kpi-icon {
  background: rgba(243, 156, 18, 0.15);
  color: #f39c12;
}

.kpi-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.kpi-label {
  font-size: 0.65rem;
  color: var(--text3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kpi-value {
  font-size: 1.1rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  line-height: 1.1;
}

.kpi-trend {
  font-size: 0.65rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-info {
  min-width: 0;
  flex: 1;
}

.kpi-trend.up {
  color: #2ecc71;
}

.kpi-trend.down {
  color: #e74c3c;
}

.kpi-trend.neutral {
  color: var(--text3);
}

/* Dash Rows */
.dash-row2,
.dash-row3,
.dash-row4 {
  display: grid;
  gap: 10px;
  padding: 0 20px;
  margin-bottom: 10px;
}

.dash-row2 {
  grid-template-columns: 1.8fr 1fr;
}

.dash-row3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.dash-row4 {
  grid-template-columns: 1fr 1fr 1fr;
}

/* Dash Cards */
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dash-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.dash-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text2);
  white-space: nowrap;
}

.dash-badge-green {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.dash-badge-red {
  background: rgba(231, 76, 60, 0.15);
  color: #ff6b6b;
}

.dash-link {
  font-size: 0.75rem;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: opacity 0.2s;
}

.dash-link:hover {
  opacity: 0.7;
}

/* ��?��,���?��,� FINANCIAL BAR CHART ��?��,���?��,� */
.fin-chart-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fin-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 100px;
}

.fin-bar-group {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  flex: 1;
}

.fin-bar-one {
  flex: 1;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  position: relative;
  transition: height 0.75s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s;
}

.fin-bar-one:hover {
  opacity: 0.8;
}

.fin-bar-label {
  font-size: 0.6rem;
  color: var(--text3);
  text-align: center;
  margin-top: 4px;
}

.fin-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text2);
}

.fin-leg-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.fin-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.fin-sum-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.fin-sum-label {
  font-size: 0.68rem;
  color: var(--text3);
  font-weight: 600;
  text-transform: uppercase;
}

.fin-sum-val {
  font-size: 0.95rem;
  font-weight: 700;
}

.fin-sum-val.green {
  color: #2ecc71;
}

.fin-sum-val.red {
  color: #e74c3c;
}

/* ��?��,���?��,� DONUT CHART ��?��,���?��,� */
.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 130px;
}

.donut-svg {
  width: 130px;
  height: 130px;
  transform: rotate(-90deg);
}

.donut-center {
  position: absolute;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  pointer-events: none;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.donut-leg-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
}

.donut-leg-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-leg-label {
  flex: 1;
  color: var(--text2);
}

.donut-leg-val {
  font-weight: 700;
  color: var(--text);
}

.donut-leg-pct {
  color: var(--text3);
  font-size: 0.7rem;
}

/* ��?��,���?��,� TECHNICIANS LIST ��?��,���?��,� */
.tech-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tech-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.tech-list-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.tech-list-info {
  flex: 1;
  min-width: 0;
}

.tech-list-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.tech-list-sub {
  font-size: 0.7rem;
  color: var(--text3);
}

.tech-list-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.tech-stat-num {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
}

.tech-stat-label {
  font-size: 0.65rem;
  color: var(--text3);
}

/* ��?��,���?��,� STOCK LIST ��?��,���?��,� */
.stock-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stock-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stock-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stock-name {
  font-size: 0.78rem;
  color: var(--text);
  font-weight: 500;
}

.stock-qty {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text2);
}

.stock-qty.stock-low {
  color: #e74c3c;
}

.stock-bar-wrap {
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.stock-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.stock-status {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  align-self: flex-end;
}

.stock-status-red {
  color: #e74c3c;
}

.stock-status-yellow {
  color: #f39c12;
}

.stock-status-green {
  color: #2ecc71;
}

/* ��?��,���?��,� RECENT OS LIST ��?��,���?��,� */
.recent-os-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recent-os-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.recent-os-item:hover {
  background: var(--surface2);
}

.recent-os-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.recent-os-info {
  flex: 1;
  min-width: 0;
}

.recent-os-id {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
}

.recent-os-client {
  font-size: 0.78rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-os-date {
  font-size: 0.68rem;
  color: var(--text3);
  white-space: nowrap;
}

/* ��?��,���?��,� NETWORK GRID ��?��,���?��,� */
.network-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.net-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.net-label {
  font-size: 0.72rem;
  color: var(--text3);
  font-weight: 600;
}

.net-status {
  font-size: 0.75rem;
  font-weight: 600;
}

.net-status.online {
  color: #2ecc71;
}

.net-status.warn {
  color: #f39c12;
}

.net-status.offline {
  color: #e74c3c;
}

.net-val {
  font-size: 0.78rem;
  color: var(--text);
  font-weight: 500;
}

/* ��?��,���?��,� INADIMPL�f�NCIA ��?��,���?��,� */
.inadimpl-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inadimpl-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inadimpl-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text2);
}

.inadimpl-bar-wrap {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.inadimpl-bar {
  height: 100%;
  border-radius: 3px;
}

.inadimpl-val {
  font-size: 0.7rem;
  color: var(--text3);
}

.inadimpl-total {
  margin-top: 4px;
  padding: 8px 12px;
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text2);
}

.inadimpl-total strong {
  color: #e74c3c;
}

/* ��?��,���?��,� PLANS LIST ��?��,���?��,� */
.plans-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.plan-speed {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  width: 65px;
  flex-shrink: 0;
}

.plan-bar-wrap {
  flex: 1;
  height: 7px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.plan-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.plan-clients {
  font-size: 0.7rem;
  color: var(--text2);
  width: 75px;
  text-align: right;
}

.plan-price {
  font-size: 0.7rem;
  font-weight: 600;
  color: #2ecc71;
  width: 70px;
  text-align: right;
}

/* ��?��,���?��,� PULSE DOT ��?��,���?��,� */
.pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ecc71;
  margin-right: 4px;
  animation: pulseDot 1.8s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes pulseDot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.3);
  }
}

/* ��?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?�
   RANKING SCREEN
��?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?� */
.ranking-podium-section {
  padding: 20px 24px 16px;
}

.podium-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 8px 0;
  min-height: 0;
}

.podium-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 14px 14px;
  border-radius: 14px;
  position: relative;
  flex: 1;
  max-width: 170px;
  transition: transform 0.2s;
}

.podium-card:hover {
  transform: translateY(-4px);
}

.podium-card.pos-1 {
  background: linear-gradient(160deg, rgba(255, 215, 0, 0.18), rgba(255, 165, 0, 0.08));
  border: 1px solid rgba(255, 215, 0, 0.3);
  padding-top: 26px;
  min-height: 200px;
}

.podium-card.pos-2 {
  background: linear-gradient(160deg, rgba(200, 200, 220, 0.15), rgba(180, 180, 200, 0.06));
  border: 1px solid rgba(200, 200, 220, 0.22);
  min-height: 170px;
}

.podium-card.pos-3 {
  background: linear-gradient(160deg, rgba(205, 127, 50, 0.15), rgba(180, 100, 20, 0.06));
  border: 1px solid rgba(205, 127, 50, 0.22);
  min-height: 155px;
}

.podium-crown {
  font-size: 1.4rem;
  position: absolute;
  top: -18px;
  animation: floatCrown 2.5s ease-in-out infinite;
}

@keyframes floatCrown {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

.podium-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  position: relative;
}

.podium-card.pos-1 .podium-avatar {
  width: 60px;
  height: 60px;
  font-size: 1.4rem;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.5);
}

.podium-rank-badge {
  position: absolute;
  bottom: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
}

.pos-1 .podium-rank-badge {
  background: #FFD700;
  color: #000;
}

.pos-2 .podium-rank-badge {
  background: #C8C8DC;
  color: #000;
}

.pos-3 .podium-rank-badge {
  background: #CD7F32;
  color: #fff;
}

.podium-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.podium-role {
  font-size: 0.68rem;
  color: var(--text3);
  text-align: center;
}

.podium-score {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(90deg, #00c6ff, #9b59f7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.podium-card.pos-1 .podium-score {
  font-size: 1.5rem;
}

.podium-score-label {
  font-size: 0.65rem;
  color: var(--text3);
  margin-top: -6px;
}

.ranking-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 16px 0 4px;
}

/* Ranking layout body */
.ranking-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  padding: 0 24px 24px;
}

.ranking-left,
.ranking-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Leaderboard rows */
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: default;
  transition: background 0.15s;
  border-radius: 8px;
  padding: 10px 8px;
}

.leaderboard-row:last-child {
  border-bottom: none;
}

.leaderboard-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.lb-rank {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
}

.lb-rank-1 {
  background: rgba(255, 215, 0, 0.2);
  color: #FFD700;
}

.lb-rank-2 {
  background: rgba(200, 200, 220, 0.15);
  color: #c0c0c0;
}

.lb-rank-3 {
  background: rgba(205, 127, 50, 0.2);
  color: #CD7F32;
}

.lb-rank-n {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text3);
}

.lb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  color: #fff;
  flex-shrink: 0;
}

.lb-info {
  flex: 1;
  min-width: 0;
}

.lb-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-role {
  font-size: 0.7rem;
  color: var(--text3);
}

.lb-bar-area {
  width: 100px;
}

.lb-bar-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 3px;
  overflow: hidden;
}

.lb-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s;
}

.lb-bar-pct {
  font-size: 0.65rem;
  color: var(--text3);
  margin-top: 3px;
}

.lb-score {
  text-align: right;
  min-width: 52px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.lb-score-label {
  font-size: 0.62rem;
  color: var(--text3);
}

.lb-trend {
  font-size: 0.72rem;
  font-weight: 600;
  min-width: 44px;
  text-align: center;
}

.lb-trend.up {
  color: #2ecc71;
}

.lb-trend.down {
  color: #e74c3c;
}

.lb-trend.flat {
  color: var(--text3);
}

/* Goal categories */
.goal-cats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}



.goal-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.goal-cat-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.goal-cat-icon {
  font-size: 0.9rem;
}

.goal-cat-vals {
  font-size: 0.75rem;
  color: var(--text3);
}

.goal-cat-vals strong {
  color: var(--text);
}

.goal-cat-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  overflow: hidden;
}

.goal-cat-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(.22, .61, .36, 1);
}

.goal-cat-leader {
  font-size: 0.68rem;
  color: var(--text3);
  margin-top: 4px;
}

.goal-cat-leader span {
  color: #00c6ff;
  font-weight: 600;
}

/* Highlights */
.highlights-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.highlight-icon {
  font-size: 1.4rem;
}

.highlight-info {
  flex: 1;
}

.highlight-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

.highlight-sub {
  font-size: 0.7rem;
  color: var(--text3);
}

.highlight-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}

.hbadge-gold {
  background: rgba(255, 215, 0, 0.15);
  color: #FFD700;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.hbadge-blue {
  background: rgba(0, 198, 255, 0.12);
  color: #00c6ff;
  border: 1px solid rgba(0, 198, 255, 0.25);
}

.hbadge-purple {
  background: rgba(155, 89, 247, 0.15);
  color: #9b59f7;
  border: 1px solid rgba(155, 89, 247, 0.3);
}

.hbadge-green {
  background: rgba(46, 204, 113, 0.12);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.25);
}

/* dash-badge utility */
.dash-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

.dash-badge-green {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.25);
}

@media (max-width: 900px) {
  .ranking-body {
    grid-template-columns: 1fr;
  }

  .podium-wrap {
    gap: 6px;
  }
}

/* =============================================
   ADMIN LAYOUT ��,��?� SIDEBAR + CONTENT
   ============================================= */

:root {
  --sidebar-w: 228px;
  --sidebar-collapsed-w: 62px;
}

.admin-layout {
  flex-direction: row !important;
  height: 100vh;
  overflow: hidden;
}

/* ��?��,���?��,� SIDEBAR ��?��,���?��,� */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 50;
}

/* Collapsed state ��,��?� desktop only */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-w);
}

/* ��?��,���?��,� SIDEBAR LOGO ��?��,���?��,� */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  height: 64px;
  flex-shrink: 0;
  overflow: hidden;
  transition: padding 0.28s, justify-content 0.28s;
}

/* When collapsed: center just the icon */
.sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding: 0;
}

.sidebar-logo-icon {
  flex-shrink: 0;
}

.sidebar-brand {
  font-size: 1.05rem;
  font-weight: 800;
  background: var(--primary-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  opacity: 1;
  max-width: 200px;
  transition: opacity 0.18s, max-width 0.28s;
}

.sidebar.collapsed .sidebar-brand {
  opacity: 0;
  max-width: 0;
  pointer-events: none;
}

/* ��?��,���?��,� SIDEBAR NAV ��?��,���?��,� */
.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Zero lateral padding when collapsed so icons sit centered */
.sidebar.collapsed .sidebar-nav {
  padding-left: 0;
  padding-right: 0;
}


.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 2px;
}

.nav-section-title {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text3);
  padding: 4px 8px 6px;
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  max-height: 30px;
  transition: opacity 0.15s, max-height 0.15s;
}

.sidebar.collapsed .nav-section-title {
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: visible;
  /* allow tooltip to escape */
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.nav-item.active {
  background: rgba(0, 198, 255, 0.1);
  color: var(--primary);
}

.nav-item.active svg {
  stroke: var(--primary);
}

.nav-item svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  transition: stroke 0.15s;
}

/* Nav item text label */
.nav-item span:not(.nav-badge-soon) {
  font-size: 0.875rem;
  font-weight: 500;
  overflow: hidden;
  opacity: 1;
  max-width: 160px;
  transition: opacity 0.15s, max-width 0.28s;
  white-space: nowrap;
}

.sidebar.collapsed .nav-item span:not(.nav-badge-soon) {
  opacity: 0;
  max-width: 0;
  pointer-events: none;
}

/* Collapsed nav items: stretch full width, icon centered */
.sidebar.collapsed .nav-item {
  width: 100%;
  justify-content: center;
  padding: 7px 0;
  gap: 0;
  background: none !important;
}

/* Bolinha: apenas no �cone �?" transparente por padr�o */
.sidebar.collapsed .nav-item svg {
  border-radius: 10px;
  padding: 9px;
  width: 18px;
  height: 18px;
  box-sizing: content-box;
  background: transparent;
  transition: background 0.15s;
}

/* Hover: bolinha sutil */
.sidebar.collapsed .nav-item:hover svg {
  background: rgba(255, 255, 255, 0.08);
}

/* Ativo: bolinha com cor do item ativo */
.sidebar.collapsed .nav-item.active svg {
  background: rgba(0, 198, 255, 0.18);
}


.nav-item-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.nav-badge-soon {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 20px;
  background: rgba(0, 198, 255, 0.12);
  color: var(--primary);
  border: 1px solid rgba(0, 198, 255, 0.2);
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.sidebar.collapsed .nav-badge-soon {
  display: none;
}

/* Tooltip on collapsed items */
.sidebar.collapsed .nav-item::after {
  content: attr(title);
  position: absolute;
  left: calc(var(--sidebar-collapsed-w) + 6px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: opacity 0.15s 0.1s;
  z-index: 200;
}

.sidebar.collapsed .nav-item:hover::after {
  opacity: 1;
}

/* ��?��,���?��,� SIDEBAR BOTTOM ��?��,���?��,� */
.sidebar-bottom {
  border-top: 1px solid var(--border);
  padding: 8px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ��?��,���?��,� TOGGLE BUTTON (bottom) ��?��,���?��,� */
.sidebar-toggle-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 8px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text3);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-toggle-bottom:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text2);
}

.sidebar-toggle-bottom svg {
  flex-shrink: 0;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed .sidebar-toggle-bottom svg {
  transform: rotate(180deg);
}

.sidebar-toggle-label {
  opacity: 1;
  max-width: 160px;
  overflow: hidden;
  transition: opacity 0.15s, max-width 0.28s;
}

.sidebar.collapsed .sidebar-toggle-label {
  opacity: 0;
  max-width: 0;
}

/* When collapsed: center the toggle button icon */
.sidebar.collapsed .sidebar-toggle-bottom {
  justify-content: center;
  padding: 8px 0;
  gap: 0;
}

/* ��?��,���?��,� SIDEBAR USER ��?��,���?��,� */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
  overflow: hidden;
}

.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 1;
  max-width: 160px;
  transition: opacity 0.15s, max-width 0.28s;
}

.sidebar.collapsed .sidebar-user-info {
  opacity: 0;
  max-width: 0;
  pointer-events: none;
}

.sidebar.collapsed .sidebar-user {
  justify-content: center;
}

.sidebar.collapsed .sidebar-user>svg {
  display: none;
}

.sidebar-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.7rem;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .user-dropdown {
  bottom: calc(100% + 8px);
  top: auto;
  left: 8px;
  right: auto;
  width: 180px;
}

/* ��?��,���?��,� MAIN CONTENT ��?��,���?��,� */
.admin-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ��?��,���?��,� VIEW TOPBAR ��?��,���?��,� */
.view-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  height: 64px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 19, 32, 0.85);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 40;
  flex-shrink: 0;
}

.view-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.view-subtitle {
  font-size: 0.78rem;
  color: var(--text2);
  margin-top: 1px;
}

/* ��?��,���?��,� HAMBURGER (mobile only) ��?��,���?��,� */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

/* ��?��,���?��,� SIDEBAR OVERLAY (mobile) ��?��,���?��,� */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 48;
  animation: fadeOverlay 0.2s ease;
}

.sidebar-overlay.active {
  display: block;
}

/* ��?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?�
   RESPONSIVE ��,��?� MOBILE (��?�� 768px)
   ��?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?���?� */
@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 49;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar.collapsed {
    width: var(--sidebar-w) !important;
  }

  .sidebar.collapsed .sidebar-logo {
    justify-content: flex-start;
    padding: 0 14px;
  }

  .sidebar-brand {
    opacity: 1 !important;
    max-width: 200px !important;
  }

  .nav-section-title {
    opacity: 1 !important;
    max-height: 30px !important;
  }

  .nav-item span {
    opacity: 1 !important;
    max-width: 160px !important;
  }

  .nav-badge-soon {
    display: inline !important;
  }

  .sidebar-user-info {
    opacity: 1 !important;
    max-width: 160px !important;
  }

  .sidebar-user>svg {
    display: flex !important;
  }

  .nav-item {
    justify-content: flex-start !important;
    padding: 9px 8px !important;
    gap: 10px !important;
    width: auto !important;
  }

  .sidebar.collapsed .nav-item {
    justify-content: flex-start !important;
    padding: 9px 8px !important;
    width: auto !important;
  }

  .sidebar-user {
    justify-content: flex-start !important;
  }

  .sidebar-toggle-bottom {
    display: none;
  }

  .sidebar.collapsed .nav-item::after {
    display: none;
  }

  /* Reset collapsed icon bolinha on mobile */
  .sidebar.collapsed .nav-item svg {
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    width: 18px !important;
    height: 18px !important;
  }
}

/* �.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.�
   MOBILE �?" Responsividade completa (�?� 768px)
   �.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.��.� */
@media (max-width: 768px) {

  /* Impede overflow horizontal em tudo */
  html,
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Admin layout: deixa conte�do scrollar verticalmente */
  .admin-layout {
    overflow: visible;
    height: auto;
    min-height: 100vh;
    flex-direction: column !important;
  }

  /* O admin-content ocupa toda a altura dispon�vel */
  .admin-content {
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
    max-width: 100vw;
  }

  /* Admin views n�o cortam conte�do */
  .admin-view,
  #view-dashboard,
  #view-kanban,
  #view-ranking {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    padding-bottom: 32px;
  }

  /* �"?�"? VIEW TOPBAR (gen�rico) �"?�"? */
  .view-topbar {
    padding: 0 12px;
    height: 52px;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .view-title {
    font-size: 0.92rem;
  }

  .view-subtitle {
    display: none;
  }

  /* Esconde o bloco com t�tulo na topbar no mobile (gen�rico, exceto kanban) */
  .view-topbar>div:not(.topbar-right):not(#kanban-view-toggle) {
    display: none;
  }

  .topbar-right {
    gap: 6px;
    flex-shrink: 0;
  }

  /* Esconde texto dos bot�es na topbar, mant�m �cone */
  .topbar-right .btn-primary,
  .topbar-right .btn-secondary {
    padding: 7px 10px;
    gap: 0;
    min-width: unset;
  }

  .topbar-right .btn-primary>svg,
  .topbar-right .btn-secondary>svg {
    flex-shrink: 0;
  }

  /* �"?�"? KANBAN TOPBAR (mobile) �?" 2 linhas �"?�"? */
  #view-kanban .view-topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 0;
    align-items: stretch;
  }

  #view-kanban .view-topbar>h2 {
    display: none;
  }

  /* Linha 1: hamburger esq + toggle centralizado */
  #view-kanban .view-topbar .hamburger-btn {
    order: 0;
    flex: 0 0 44px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Toggle: tabs com linha ativa, centralizado na linha 1 */
  #view-kanban #kanban-view-toggle {
    display: flex !important;
    order: 1;
    flex: 1;
    align-items: stretch;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    height: 48px;
  }

  #view-kanban #kanban-view-toggle button {
    flex: 1;
    height: 100%;
    padding: 0 8px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--text3) !important;
    border-bottom: 2px solid transparent !important;
    transition: color .18s, border-color .18s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    white-space: nowrap;
  }

  #view-kanban #kanban-view-toggle button.tab-active {
    color: var(--text) !important;
    background: transparent !important;
    border-bottom-color: var(--accent) !important;
  }

  /* Linha 2: topbar-right �?" busca + per�odo + Nova OS */
  #view-kanban .topbar-right {
    order: 2;
    width: 100%;
    margin-left: 0;
    padding: 6px 12px;
    gap: 8px;
    flex-wrap: nowrap;
    border-top: 1px solid var(--border);
  }

  /* Busca ocupa o espa�o dispon�vel */
  #view-kanban #kanban-search-wrap {
    flex: 1;
    min-width: 0;
    width: auto !important;
  }

  #view-kanban #filter-tech {
    display: none !important;
  }

  /* Per�odo: tamanho baseado no conte�do, n�o cresce */
  #view-kanban #filter-periodo {
    flex: 0 0 auto;
    width: auto;
    font-size: 0.8rem;
    padding: 6px 28px 6px 10px;
  }

  #view-kanban #btn-nova-os {
    flex: 0 0 auto;
    font-size: 0.8rem;
    padding: 6px 12px;
    white-space: nowrap;
  }

  /* DASHBOARD */
  .dash-kpi-grid,
  #dash-kpi-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 10px 14px !important;
  }

  .kpi-card {
    padding: 12px;
    gap: 10px;
  }

  .kpi-value {
    font-size: 1.05rem;
  }

  .kpi-icon {
    width: 36px;
    height: 36px;
  }

  .kpi-icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  .kpi-trend {
    font-size: 0.68rem;
  }

  .dash-row2,
  .dash-row3,
  .dash-row4 {
    grid-template-columns: 1fr !important;
    padding: 0 14px;
    gap: 12px;
    margin-bottom: 12px;
  }

  .dash-card {
    padding: 14px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .fin-summary {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .fin-bar-chart {
    height: 80px;
  }

  /* �"?�"? KANBAN �"?�"? */
  .stats-bar {
    padding: 10px 14px;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .stats-bar::-webkit-scrollbar {
    display: none;
  }

  .stat-card {
    min-width: 90px;
    flex-shrink: 0;
    padding: 10px 12px;
  }

  .kanban-board {
    padding: 12px 14px;
    gap: 14px;
    flex-direction: column;
    overflow-x: visible;
  }

  .kanban-col {
    width: 100% !important;
    min-width: unset !important;
    max-width: 100% !important;
    flex-shrink: 0;
  }

  /* �"?�"? RANKING �"?�"? */
  .ranking-body {
    grid-template-columns: 1fr !important;
    padding: 14px;
    gap: 14px;
  }

  .podium-wrap {
    gap: 6px;
  }

  .podium-card {
    padding: 12px 8px;
  }

  .rank-table {
    font-size: 0.8rem;
  }

  .rank-table th,
  .rank-table td {
    padding: 8px 8px;
    font-size: 0.76rem;
  }

  /* �"?�"? MODAIS �?" bottom sheet (modal-card) �"?�"? */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    max-width: 100%;
    width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: 88vh;
  }

  /* �"?�"? MODAIS DO ESTOQUE �?" centralizados e grandes �"?�"? */
  .modal-overlay:has(.modal-box) {
    align-items: center;
    justify-content: center;
    padding: 12px;
  }

  /* �"?�"? MODAIS CENTRALIZADOS NO MOBILE �"?�"? */
  #modal-close-os,
  #modal-exec,
  #modal-subst,
  #modal-perfil {
    align-items: center;
    padding: 16px;
  }

  #modal-close-os .modal-card,
  #modal-exec .modal-card,
  #modal-subst .modal-card,
  #modal-perfil .modal-card {
    border-radius: 20px;
    max-height: 92vh;
    overflow-y: auto;
  }

  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    border-radius: var(--radius) !important;
    overflow-y: auto;
  }

  /* �"?�"? TELAS MUITO PEQUENAS (< 420px) �"?�"? */
  @media (max-width: 420px) {
    .dash-kpi-grid {
      grid-template-columns: 1fr;
    }

    .kpi-card {
      flex-direction: row;
      align-items: center;
    }

    .fin-summary {
      grid-template-columns: 1fr;
    }
  }
}

/* �"?�"?�"? CPF SEARCH FLOW �"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"? */
.cpf-step-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.cpf-step-desc {
  font-size: 0.8rem;
  color: var(--text3);
  margin: 0 0 16px;
}

.cpf-search-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.cpf-search-row input {
  flex: 1;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.cpf-search-row .btn-primary {
  width: auto;
  padding: 0 22px;
  flex-shrink: 0;
  font-size: 0.88rem;
}

.cpf-result-area {
  margin-top: 18px;
}

/* �"?�"?�"? Cliente encontrado �"?�"?�"? */
.cliente-result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 198, 255, 0.06);
  border: 1px solid rgba(0, 198, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.cliente-result-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  flex-shrink: 0;
}

.cliente-result-info {
  flex: 1;
}

.cliente-result-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 2px;
}

.cliente-result-cpf {
  font-size: 0.75rem;
  color: var(--text3);
}

/* �"?�"?�"? Contratos grid �"?�"?�"? */
.contratos-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
}

.contratos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 520px) {
  .contratos-grid {
    grid-template-columns: 1fr;
  }
}

.contrato-card {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  outline: none;
}

.contrato-card:hover {
  border-color: rgba(0, 198, 255, 0.4);
  background: rgba(0, 198, 255, 0.05);
}

.contrato-card.selected {
  border-color: var(--primary);
  background: rgba(0, 198, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 198, 255, 0.15);
}

.contrato-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text3);
  margin-bottom: 4px;
  letter-spacing: 0.03em;
}

.contrato-plano {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
  line-height: 1.3;
}

.contrato-endereco {
  font-size: 0.71rem;
  color: var(--text3);
  line-height: 1.4;
  margin-bottom: 8px;
}

.contrato-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 99px;
}

.contrato-status.ativo {
  background: rgba(0, 198, 160, 0.14);
  color: #00c6a0;
}

.contrato-status.inativo {
  background: rgba(231, 76, 60, 0.14);
  color: #e74c3c;
}

/* �"?�"?�"? Erro CPF �"?�"?�"? */
.cpf-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #ff6b6b;
  font-size: 0.82rem;
}

/* �"?�"?�"? Banner cliente no Step 2 �"?�"?�"? */
.cliente-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 198, 255, 0.06);
  border: 1px solid rgba(0, 198, 255, 0.18);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
}

.cliente-banner-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  color: #fff;
  flex-shrink: 0;
}

.cliente-banner-info {
  flex: 1;
}

.cliente-banner-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}

.cliente-banner-contract {
  font-size: 0.72rem;
  color: var(--text3);
  margin-top: 1px;
}

.btn-trocar-contrato {
  margin-left: auto;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 6px;
  color: var(--primary);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn-trocar-contrato:hover {
  background: rgba(0, 198, 255, 0.08);
  border-color: var(--primary);
}

/* �"?�"?�"? ESTOQUE �"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"? */
.estoque-stats {
  display: flex;
  gap: 14px;
  padding: 20px 24px 0;
  flex-wrap: wrap;
}

.estoque-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  min-width: 130px;
  flex: 1;
}

.estoque-stat-card.estat-alert {
  border-color: rgba(231, 76, 60, 0.4);
  background: rgba(231, 76, 60, 0.06);
}

.estat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.estat-value.estat-blue {
  color: #3b8fd4;
}

.estat-value.estat-orange {
  color: #f0b429;
}

.estat-value.estat-red {
  color: #e74c3c;
}

.estat-label {
  font-size: 0.78rem;
  color: var(--text3);
  font-weight: 500;
}

.estoque-tabs-bar {
  display: flex;
  gap: 4px;
  padding: 16px 24px 0;
  border-bottom: 1px solid var(--border);
  margin: 0 0 0;
}

.estoque-tab,
.fin-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text3);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}

.estoque-tab:hover,
.fin-tab:hover {
  color: var(--text);
}

.estoque-tab.active,
.fin-tab.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary-light);
}

.fin-pill {
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.fin-pill:hover {
  color: var(--text);
}

.fin-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.estoque-tab-content {
  padding: 20px 24px;
  flex: 1;
  overflow: auto;
}

.estoque-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.estoque-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.estoque-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.estoque-table th {
  background: var(--surface);
  color: var(--text3);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.estoque-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text);
  vertical-align: middle;
}

.estoque-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.estoque-table tbody tr:last-child td {
  border-bottom: none;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.form-input:focus {
  border-color: var(--primary-light);
}

.form-input::placeholder {
  color: var(--text3);
}

.form-input option {
  background: #1a1f2e;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row>div {
  flex: 1;
  min-width: 0;
}

.form-error {
  font-size: 0.82rem;
  color: #e74c3c;
  margin-top: 2px;
}

/* �"?�"? Estoque topbar responsivo �"?�"? */
.estoque-topbar-btns {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.estoque-menu-wrap {
  display: none;
  position: relative;
}

.estoque-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 210px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.estoque-menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text1);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
}

.estoque-menu-dropdown button:last-child {
  border-bottom: none;
}

.estoque-menu-dropdown button:hover {
  background: var(--surface3);
}

@media (max-width: 700px) {
  .estoque-topbar-btns {
    display: none;
  }

  .estoque-menu-wrap {
    display: block;
  }
}

/* �"?�"? Painel de detalhes da OS em execu��o �"?�"? */
.os-info-panel {
  border-top: 1px solid rgba(155, 89, 247, 0.25);
  background: rgba(155, 89, 247, 0.04);
}

.os-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  cursor: pointer;
  user-select: none;
}

.os-info-header:active {
  opacity: 0.7;
}

.os-info-body {
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-maps-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(0, 198, 160, 0.15), rgba(0, 198, 160, 0.08));
  border: 1px solid rgba(0, 198, 160, 0.3);
  color: #00c6a0;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.btn-maps-link:active {
  opacity: 0.75;
}

.os-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.os-info-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
}

.os-info-full {
  grid-column: 1 / -1;
}

.os-info-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.os-info-val {
  font-size: 0.85rem;
  color: var(--text1);
  font-weight: 500;
  word-break: break-all;
}

/* �"?�"? MODAL SUBSTITUI�?�fO DE EQUIPAMENTO �"?�"? */
.subst-steps-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px 0;
}

.subst-step-ind {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text3);
  flex: 1;
}

.subst-step-active {
  color: var(--primary);
}

.subst-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.subst-step-active .subst-step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
}

.subst-step-sep {
  color: var(--text3);
  font-size: 1rem;
}

.subst-cam-area {
  width: 100%;
  min-height: 120px;
  background: var(--surface2);
  border: 1.5px dashed var(--border2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.subst-cam-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text3);
  font-size: 0.78rem;
}

.subst-ia-status {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.subst-ia-status.analisando {
  background: rgba(155, 89, 247, 0.12);
  border: 1px solid rgba(155, 89, 247, 0.25);
  color: #9b59f7;
}

.subst-ia-status.ok {
  background: rgba(0, 198, 160, 0.12);
  border: 1px solid rgba(0, 198, 160, 0.25);
  color: #00c6a0;
}

.subst-ia-status.erro {
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.25);
  color: #e74c3c;
}

.subst-equip-card {
  padding: 12px;
  background: rgba(0, 198, 160, 0.08);
  border: 1.5px solid rgba(0, 198, 160, 0.3);
  border-radius: var(--radius-sm);
  margin-top: 10px;
}

.subst-equip-card.error {
  background: rgba(231, 76, 60, 0.08);
  border-color: rgba(231, 76, 60, 0.3);
}

.subst-equip-card .equip-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 2px;
}

.subst-equip-card .equip-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  font-family: monospace;
}

/* �"?�"? CARDS DE LOCAIS �"?�"? */
.local-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px;
}

.local-card-tecnico {
  border-color: rgba(155, 89, 247, 0.3);
  background: rgba(155, 89, 247, 0.05);
}

.local-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.local-card-nome {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.local-card-desc {
  font-size: 0.78rem;
  color: var(--text3);
  margin-top: 2px;
}

.local-card-count {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  background: rgba(0, 198, 160, 0.12);
  color: #00c6a0;
  white-space: nowrap;
}

/* �"?�"?�"? TECH DRAWER �"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"? */
.tech-hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-radius: 8px;
  transition: background .2s;
}

.tech-hamburger:active {
  background: rgba(255, 255, 255, 0.08);
}

.tech-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: all .25s;
}

.tech-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  transition: opacity .25s;
}

.tech-drawer-overlay.hidden {
  display: none;
}

.tech-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  z-index: 1101;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
}

.tech-drawer.open {
  transform: translateX(0);
}

.tech-drawer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.tech-drawer-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.tech-drawer-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.tech-drawer-role {
  font-size: 0.72rem;
  color: var(--text3);
  margin-top: 2px;
}

.tech-drawer-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}

.tech-drawer-close:active {
  background: rgba(255, 255, 255, 0.07);
}

.tech-drawer-menu {
  padding: 12px 0;
  flex: 1;
}

.tech-drawer-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 8px 18px 6px;
}

.tech-drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 18px;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
  border-radius: 0;
}

.tech-drawer-item:active {
  background: rgba(255, 255, 255, 0.06);
}

.tech-drawer-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(74, 158, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a9eff;
  flex-shrink: 0;
}

.tech-drawer-item-arrow {
  margin-left: auto;
  color: var(--text3);
}

/* �"?�"?�"? TECH INFRA SCREEN �"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"? */
.tech-infra-screen {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}

.tech-infra-screen.open {
  transform: translateX(0);
}

.tech-infra-screen.hidden {
  display: none;
}

.tech-infra-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 14px;
  background: rgba(10, 13, 20, 0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.tech-infra-back {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 8px;
}

.tech-infra-back:active {
  background: rgba(255, 255, 255, 0.07);
}

.tech-infra-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.tech-infra-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
}

.tech-infra-search-row {
  margin-bottom: 10px;
}

.tech-infra-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--text3);
}

.tech-infra-search-wrap input {
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.88rem;
  flex: 1;
  outline: none;
}

.tech-infra-search-wrap input::placeholder {
  color: var(--text3);
}

.tech-infra-chips {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.tech-infra-chip {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text3);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.tech-infra-chip.active {
  background: rgba(74, 158, 255, 0.15);
  border-color: rgba(74, 158, 255, 0.4);
  color: #4a9eff;
}

.tech-infra-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tech-infra-cto-card {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 12px 14px;
}

.tech-infra-cto-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.tech-infra-cto-num {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.tech-infra-cto-badge-fibranet {
  background: rgba(0, 198, 160, 0.12);
  color: #00c6a0;
  border: 1px solid rgba(0, 198, 160, 0.25);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.65rem;
  font-weight: 700;
}

.tech-infra-cto-badge-parceiro {
  background: rgba(240, 180, 41, 0.12);
  color: #f0b429;
  border: 1px solid rgba(240, 180, 41, 0.25);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.65rem;
  font-weight: 700;
}

.tech-infra-cto-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.tech-infra-cto-btn {
  background: none;
  border: 1px solid var(--border2);
  color: var(--text3);
  border-radius: 8px;
  padding: 5px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
}

.tech-infra-cto-btn:active {
  background: rgba(255, 255, 255, 0.06);
}

.tech-infra-cto-cap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tech-infra-cap-bar {
  flex: 1;
  height: 5px;
  background: var(--border2);
  border-radius: 3px;
  overflow: hidden;
}

.tech-infra-cap-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .3s;
}

.tech-infra-cap-text {
  font-size: 0.72rem;
  color: var(--text3);
  white-space: nowrap;
  min-width: 60px;
  text-align: right;
}

/* �"?�"?�"? TECH INFRA �?" MAPA + TABS �"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"? */
.tech-infra-view-toggle {
  margin-left: auto;
  display: flex;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  overflow: hidden;
}

.tech-infra-view-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.tech-infra-view-btn.active {
  background: rgba(74, 158, 255, 0.15);
  color: #4a9eff;
}

.tech-infra-mapa-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.tech-infra-map {
  flex: 1;
  min-height: 0;
}

.tech-infra-nearby-lista-panel {
  padding: 8px 14px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}

.tech-infra-nearby-panel {
  background: rgba(10, 13, 20, 0.96);
  border-top: 1px solid var(--border);
  padding: 10px 14px 12px;
  flex-shrink: 0;
}

.tech-infra-nearby-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tech-infra-nearby-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(74, 158, 255, 0.12);
  color: #4a9eff;
  border: 1px solid rgba(74, 158, 255, 0.3);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
  flex-shrink: 0;
}

.tech-infra-nearby-btn:active {
  background: rgba(74, 158, 255, 0.22);
}

.tech-infra-radius-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.tech-infra-radius-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #4a9eff;
  text-align: center;
}

.tech-infra-radius-slider {
  width: 100%;
  accent-color: #4a9eff;
  cursor: pointer;
  height: 4px;
}

.tech-infra-nearby-result {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.tech-infra-nearby-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 8px 10px;
}

.tech-infra-nearby-dist {
  font-size: 0.72rem;
  color: var(--text3);
  margin-left: auto;
  white-space: nowrap;
}

/* �"?�"?�"? PROVISIONAMENTO �"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"? */
.nav-prov-badge {
  background: #e74c3c;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 10px;
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  margin-left: 4px;
}

.sidebar.collapsed .nav-prov-badge {
  display: none !important;
}

.prov-tabs-bar {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.prov-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: -1px;
}

.prov-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.prov-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prov-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.prov-card-id {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary);
}

.prov-card-tipo {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(155, 89, 247, 0.15);
  color: #b97ff5;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.prov-card-tipo.tipo-migrar {
  background: rgba(0, 198, 255, 0.12);
  color: #00c6ff;
}

.prov-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}

.prov-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prov-meta-label {
  font-size: 0.7rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.prov-meta-val {
  font-size: 0.82rem;
  color: var(--text);
  font-family: monospace;
}

.prov-card-photos {
  display: flex;
  gap: 8px;
}

.prov-card-photos img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.prov-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.prov-card-time {
  font-size: 0.75rem;
  color: var(--text3);
}

.btn-prov-done {
  background: rgba(0, 198, 160, 0.12);
  color: #00c6a0;
  border: 1px solid rgba(0, 198, 160, 0.3);
  border-radius: 8px;
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}

.btn-prov-done:hover {
  background: rgba(0, 198, 160, 0.22);
}

.btn-provisionar {
  width: 100%;
  font-size: 0.78rem;
  padding: 7px;
  color: #b97ff5;
  border-color: rgba(155, 89, 247, 0.35);
  background: rgba(155, 89, 247, 0.07);
  border: 1px solid rgba(155, 89, 247, 0.35);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .2s;
}

.btn-provisionar:hover {
  background: rgba(155, 89, 247, 0.14);
}

.btn-migrar-cto {
  width: 100%;
  font-size: 0.78rem;
  padding: 7px;
  color: #00c6ff;
  border: 1px solid rgba(0, 198, 255, 0.3);
  background: rgba(0, 198, 255, 0.07);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .2s;
}

.btn-migrar-cto:hover {
  background: rgba(0, 198, 255, 0.14);
}

/* �"?�"?�"? MODAL BACKDROP (provisionamento) �"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"? */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop .modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.modal-backdrop .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-backdrop .modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.modal-backdrop .modal-close {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop .modal-close:hover {
  background: rgba(255, 255, 255, 0.07);
}

.modal-backdrop .modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-backdrop .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.prov-photo-area {
  display: flex;
  gap: 8px;
}

.prov-photo-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--surface2);
  border: 1.5px dashed var(--border2);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text2);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  transition: border-color .2s, background .2s;
}

.prov-photo-btn:hover {
  border-color: var(--primary);
  background: rgba(0, 198, 255, 0.06);
  color: var(--primary);
}

.prov-photo-preview {
  width: 100%;
  border-radius: 8px;
  max-height: 160px;
  object-fit: cover;
  border: 1px solid var(--border);
  margin-top: 6px;
}

/* =============================================
   M�"DULO: MEU VE�CULO
   ============================================= */

/* Tela principal */
.veiculo-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 320;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(.4, 0, .2, 1);
}

.veiculo-screen.hidden {
  display: none;
}

.veiculo-screen.open {
  transform: translateX(0);
}

.veiculo-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.veiculo-back {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
}

.veiculo-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.veiculo-abast-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

/* Resumo */
.veiculo-resumo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px 14px 10px;
  flex-shrink: 0;
}

.veiculo-resumo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}

.veiculo-resumo-label {
  font-size: 0.68rem;
  color: var(--text3);
  margin-bottom: 4px;
}

.veiculo-resumo-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* Tabs */
.veiculo-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}

.veiculo-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  transition: all .2s;
}

.veiculo-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Lista */
.veiculo-list-wrap {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.veiculo-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0;
}

.veiculo-km-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

/* Popup KM */
.popup-km-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.popup-km-overlay.hidden {
  display: none;
}

.popup-km-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 20px;
  width: 100%;
  max-width: 380px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.popup-km-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.popup-km-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.popup-km-sub {
  font-size: 0.78rem;
  color: var(--text3);
  margin-top: 3px;
  line-height: 1.4;
}

.popup-km-preview {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}

.popup-km-preview.hidden {
  display: none;
}

.popup-km-preview img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  display: block;
}

.popup-km-ia-result {
  padding: 8px 12px;
  background: rgba(0, 198, 160, 0.08);
  color: #00c6a0;
  font-size: 0.82rem;
  font-weight: 600;
}

.popup-km-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.popup-km-foto-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 12px;
  color: var(--text2);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s;
}

.popup-km-foto-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.popup-km-confirm-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

.popup-km-confirm-btn.hidden {
  display: none;
}

.popup-km-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text3);
  font-size: 0.82rem;
}

.popup-km-loading.hidden {
  display: none;
}

.popup-km-error {
  color: #e74c3c;
  font-size: 0.78rem;
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  line-height: 1.4;
}

.popup-km-error.hidden {
  display: none;
}

.popup-km-saida-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
}

/* Modal abastecimento */
.abast-modal-card {
  max-width: 400px;
  width: calc(100% - 32px);
  border-radius: 18px !important;
  margin: auto;
}

.abast-cupom-preview {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 6px;
}

.abast-cupom-preview.hidden {
  display: none;
}

.abast-cupom-preview img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

.abast-foto-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed var(--border2);
  border-radius: 12px;
  padding: 28px 16px;
  color: var(--text3);
  cursor: pointer;
  transition: border-color .2s, background .2s;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.abast-foto-zone:hover {
  border-color: var(--primary);
  background: rgba(0, 198, 255, 0.04);
}

.abast-foto-zone span {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text2);
}

.abast-foto-zone small {
  font-size: 0.72rem;
  color: var(--text3);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

/* =============================================
   M�"DULO: FROTA (ADMIN)
   ============================================= */

.frota-tabs-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  overflow-x: auto;
}

.frota-tab {
  flex: 1;
  min-width: 110px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 11px 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

.frota-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.frota-tab-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.frota-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.frota-search {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
}

.frota-search:focus {
  border-color: var(--primary);
}

.frota-filter-sel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--text);
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
}

.frota-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.frota-empty {
  color: var(--text3);
  text-align: center;
  padding: 40px 0;
  font-size: 0.85rem;
}

.frota-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}

.frota-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.frota-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.frota-row-info {
  flex: 1;
  min-width: 0;
}

.frota-row-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frota-row-sub {
  font-size: 0.72rem;
  color: var(--text3);
  margin-top: 2px;
}

.frota-edit-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.75rem;
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s;
}

.frota-edit-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.frota-badge-ok {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(0, 198, 160, 0.12);
  color: #00c6a0;
  border: 1px solid rgba(0, 198, 160, 0.3);
}

.frota-badge-off {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.frota-badge-tech {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(74, 158, 255, 0.12);
  color: #4a9eff;
  border: 1px solid rgba(74, 158, 255, 0.3);
}

.frota-resumo-cards {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 12px 20px;
  flex-shrink: 0;
}

.frota-resumo-card {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}

.frota-resumo-label {
  font-size: 0.68rem;
  color: var(--text3);
  margin-bottom: 4px;
}

.frota-resumo-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

/* �"?�"?�"? CLIENTES �"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"? */
.clientes-kpis {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 10px 20px 8px;
  flex-shrink: 0;
}

.cli-kpis-row {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.cli-kpi-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  min-width: 0;
}

.cli-kpi-card:hover {
  background: var(--surface2);
}

.cli-kpi-card.active {
  background: rgba(74, 158, 255, .08);
}

.cli-kpi-val {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.1;
}

.cli-kpi-label {
  font-size: 0.62rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cli-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.cli-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cli-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.cli-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap;
  margin: 1px 2px 1px 0;
}

.cli-row:hover td {
  background: var(--surface2);
}

/* Modal cliente */
.cli-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border2);
}

.cli-modal-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.cli-modal-nome {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.cli-modal-cpf {
  font-size: 0.75rem;
  color: var(--text3);
  margin-top: 2px;
  font-family: monospace;
}

.cli-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cli-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border2);
}

.cli-info-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cli-info-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: 8px;
}

.cli-info-icon {
  color: var(--text3);
  margin-top: 2px;
  flex-shrink: 0;
}

.cli-info-label {
  font-size: 0.65rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 1px;
}

.cli-info-value {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
}

.cli-contrato-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.cli-contrato-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface3);
}

.cli-contrato-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.cli-contrato-plano {
  font-size: 0.72rem;
  color: var(--text3);
  margin-left: 8px;
}

.cli-contrato-body {
  padding: 8px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}

.cli-contrato-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cli-contrato-label {
  font-size: 0.62rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.cli-contrato-val {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 500;
}

.cli-endereco {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 14px;
  border-top: 1px solid var(--border2);
  font-size: 0.78rem;
  color: var(--text3);
  line-height: 1.45;
}

.cli-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid;
  white-space: nowrap;
}

.cli-os-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  background: var(--surface2);
}

.cli-os-id {
  font-weight: 600;
  color: var(--text3);
  width: 76px;
  flex-shrink: 0;
}

.cli-os-tipo {
  flex: 1;
  color: var(--text);
}

.cli-os-dt {
  color: var(--text3);
  flex-shrink: 0;
}

/* �"?�"?�"? OS ANALYTICS �"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"?�"? */
#view-os-analytics {
  overflow-y: auto;
  gap: 0;
}

#osa-kpis {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  margin-top: 16px;
}

#osa-kpis .kpi-card {
  cursor: default;
}

.osa-row2,
.osa-row3,
.osa-row4 {
  display: flex;
  gap: 14px;
  padding: 14px 20px 0;
  flex-shrink: 0;
}

.osa-row4 {
  padding-bottom: 20px;
}

.osa-card-wide {
  flex: 2;
  min-width: 0;
}

.osa-row2 .dash-card,
.osa-row3 .dash-card,
.osa-row4 .dash-card {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

/* Trend chart */
.osa-trend-chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.osa-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 130px;
  padding: 0 4px;
}

.osa-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.osa-bar-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.osa-bar-bg {
  width: 80%;
  height: 100%;
  background: var(--surface3);
  border-radius: 4px 4px 0 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.osa-bar-fill {
  width: 100%;
  border-radius: 2px 2px 0 0;
  transition: height .4s ease;
  position: absolute;
  bottom: 0;
  left: 0;
}

.osa-bar-done {
  z-index: 1;
}

.osa-bar-val {
  font-size: 0.65rem;
  color: var(--text3);
  font-weight: 600;
}

.osa-bar-label {
  font-size: 0.6rem;
  color: var(--text3);
  white-space: nowrap;
}

.osa-trend-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text3);
  margin-top: 4px;
  padding: 0 4px;
}

.osa-leg-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* Tipos chart */
.osa-tipos-chart {
  margin-top: 4px;
}

.osa-tipos-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.osa-tipo-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.osa-tipo-label {
  font-size: 0.75rem;
  color: var(--text2);
  width: 110px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.osa-tipo-bar-wrap {
  flex: 1;
  background: var(--surface3);
  border-radius: 3px;
  height: 8px;
  overflow: hidden;
}

.osa-tipo-bar {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
  min-width: 2px;
}

.osa-tipo-qty {
  font-size: 0.72rem;
  color: var(--text3);
  width: 60px;
  flex-shrink: 0;
  text-align: right;
}

.osa-tipo-qty small {
  opacity: .7;
}

/* Bairros list */
.osa-bairros-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 280px;
}

.osa-bairro-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.osa-bairro-rank {
  font-size: 0.68rem;
  color: var(--text3);
  width: 16px;
  flex-shrink: 0;
  text-align: center;
  font-weight: 700;
}

.osa-bairro-info {
  flex: 1;
  min-width: 0;
}

.osa-bairro-nome {
  font-size: 0.75rem;
  color: var(--text);
  display: block;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.osa-bairro-bar-wrap {
  background: var(--surface3);
  border-radius: 3px;
  height: 5px;
  overflow: hidden;
}

.osa-bairro-bar {
  height: 100%;
  background: linear-gradient(90deg, #4a9eff, #9b59f7);
  border-radius: 3px;
  transition: width .4s ease;
}

.osa-bairro-qty {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text2);
  width: 28px;
  flex-shrink: 0;
  text-align: right;
}

/* T�cnicos table */
.osa-tecnicos-list {
  overflow-x: auto;
}

.osa-tec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.osa-tec-table th {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.osa-tec-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border2);
  color: var(--text2);
  white-space: nowrap;
}

.osa-tec-table tr:last-child td {
  border-bottom: none;
}

/* Dias da semana */
.osa-dias-chart-wrap {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 130px;
  padding: 0 4px;
  margin-top: 8px;
}

.osa-dia-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.osa-dia-val {
  font-size: 0.65rem;
  color: var(--text3);
  font-weight: 600;
}

.osa-dia-bar-wrap {
  flex: 1;
  width: 70%;
  background: var(--surface3);
  border-radius: 4px 4px 0 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.osa-dia-bar {
  width: 100%;
  border-radius: 2px 2px 0 0;
  transition: height .4s ease;
}

.osa-dia-label {
  font-size: 0.65rem;
  color: var(--text3);
}

.osa-dia-weekend {
  color: #9b59f7;
}

/* Retorno */
.osa-retorno-list {
  overflow-y: auto;
  max-height: 260px;
}

.osa-retorno-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

.osa-retorno-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.osa-retorno-nome {
  font-size: 0.75rem;
  color: var(--text2);
  width: 110px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.osa-retorno-bar-wrap {
  flex: 1;
  background: var(--surface3);
  border-radius: 3px;
  height: 6px;
  overflow: hidden;
}

.osa-retorno-bar {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
  min-width: 2px;
}

.osa-retorno-taxa {
  font-size: 0.72rem;
  font-weight: 700;
  width: 36px;
  flex-shrink: 0;
  text-align: right;
}

.osa-retorno-detail {
  font-size: 0.65rem;
  color: var(--text3);
  flex-shrink: 0;
}

.osa-empty {
  font-size: 0.78rem;
  color: var(--text3);
  text-align: center;
  padding: 20px 8px;
  line-height: 1.5;
}

@media (max-width: 900px) {

  .osa-row2,
  .osa-row3,
  .osa-row4 {
    flex-direction: column;
  }

  .osa-card-wide {
    flex: 1;
  }

  #osa-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── FATURAS ──────────────────────────────── */
.fat-tabs-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  background: var(--bg1);
  flex-shrink: 0;
}

.fat-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text3);
  padding: 12px 18px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}

.fat-tab:hover {
  color: var(--text1);
}

.fat-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.fat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.fat-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--text3);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.fat-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.fat-table tr:last-child td {
  border-bottom: none;
}

.fat-table tr:hover td {
  background: var(--bg3);
}

.fat-status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
}

.fat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.fat-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.fat-kpi {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

.fat-kpi-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.fat-kpi-val {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.fat-kpi-label {
  font-size: 0.78rem;
  color: var(--text3);
  margin-top: 4px;
}

.fat-filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.fat-filter-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all .15s;
}

.fat-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.fat-filter-btn:hover:not(.active) {
  border-color: var(--accent);
  color: var(--accent);
}

.fat-item-row {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.fat-item-name {
  font-weight: 500;
  font-size: 0.88rem;
}

.fat-item-sub {
  color: var(--text3);
  font-size: 0.78rem;
  margin-top: 3px;
}

.fat-item-msg {
  color: var(--text3);
  font-size: 0.74rem;
  margin-top: 4px;
}

.fat-action-btn {
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
}

.fat-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.fat-action-btn.primary {
  border: none;
  background: var(--accent);
  color: #fff;
}

.fat-action-btn.primary:hover {
  opacity: 0.85;
}

.fat-action-btn.danger {
  color: #ef4444;
}

.fat-action-btn.danger:hover {
  border-color: #ef4444;
  background: #ef444411;
}

/* Filtro de período — Kanban Cobrança */
.cob-filter-btn {
  padding: 4px 12px;
  font-size: 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.cob-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cob-filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Kanban Cobrança Ativa */
.fat-cob-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 20px 20px;
  align-items: flex-start;
  flex: 1;
}

.fat-cob-col {
  flex: 0 0 280px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.fat-cob-col-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.fat-cob-col-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fat-cob-col-title {
  font-weight: 600;
  font-size: 0.85rem;
  flex: 1;
}

.fat-cob-col-count {
  font-size: 0.75rem;
  background: var(--bg3);
  padding: 2px 8px;
  border-radius: 20px;
  color: var(--text3);
}

.fat-cob-cards {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fat-cob-card {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color .15s;
}

.fat-cob-card:hover {
  border-color: var(--accent);
}

.fat-cob-card-nome {
  font-weight: 600;
  font-size: 0.85rem;
}

.fat-cob-card-tel {
  color: var(--text3);
  font-size: 0.75rem;
}

.fat-cob-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.fat-cob-card-valor {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ef4444;
}

.fat-cob-card-dias {
  font-size: 0.72rem;
  color: var(--text3);
  background: var(--bg3);
  padding: 2px 7px;
  border-radius: 20px;
}

/* Agrupador etapas na Cadência */
.fat-etapa-group-header {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text2);
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fat-etapa-group-header:first-child {
  margin-top: 0;
}

/* Cards de etapa */
.fat-etapa-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  cursor: default;
  transition: border-top-color .1s;
}

.fat-etapa-drag-handle {
  font-size: 1.1rem;
  color: var(--text3);
  cursor: grab;
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
}

.fat-etapa-drag-handle:active {
  cursor: grabbing;
}

.fat-etapa-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fat-etapa-info {
  flex: 1;
}

.fat-etapa-nome {
  font-weight: 600;
  font-size: 0.88rem;
}

.fat-etapa-badges {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.fat-toggle {
  width: 38px;
  height: 20px;
  border-radius: 10px;
  background: var(--surface3);
  position: relative;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.fat-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text3);
  transition: left .2s, background .2s;
}

.fat-toggle-on {
  background: #10b98133;
  border-color: #10b981;
}

.fat-toggle-on::after {
  left: 20px;
  background: #10b981;
}

@media (max-width: 768px) {
  .fat-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .fat-tabs-bar {
    overflow-x: auto;
  }

  .fat-tab {
    padding: 10px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .fat-table {
    font-size: 0.76rem;
  }
}

/* ── PWA Install Banner ── */
#pwa-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  transform: translateY(120%);
  background: #1a1f2e;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.15);
  z-index: 99999;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}

/* ── Login Mobile — simples e centralizado ── */
@media (max-width: 640px) {

  /* Impede scroll enquanto login está ativo */
  body:has(#login-screen.active) {
    overflow: hidden;
    height: 100dvh;
    min-height: unset;
  }

  #login-screen {
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: unset !important; /* anula .screen { min-height: 100vh } que causa scroll */
    height: 100dvh !important;
    max-height: 100dvh;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
  }

  .login-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100%;
    max-width: 100%;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0 24px;
    border-radius: 0;
    animation: none;
    box-sizing: border-box;
  }

  .login-card::before { display: none; }

  .login-logo {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center;
    gap: 2px;
    margin-bottom: 32px;
    width: 100%;
  }

  .logo-icon {
    width: min(28vw, 140px);
    height: min(28vw, 140px);
    border-radius: 22px;
    overflow: hidden;
    margin-bottom: 2px;
    flex-shrink: 0;
  }

  .logo-icon img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    display: block;
  }

  .login-brand    { font-size: 1.9rem; text-align: center; width: 100%; }
  .login-subtitle { font-size: 0.82rem; text-align: center; width: 100%; }

  .login-title { font-size: 1.2rem; text-align: left; }
  .login-desc  { font-size: 0.82rem; margin-bottom: 24px; text-align: left; }

  #login-user,
  #login-pass {
    padding-top: 13px !important;
    padding-bottom: 13px !important;
    font-size: 0.95rem !important;
  }

  #btn-login {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 14px;
    margin-top: 8px;
  }
}