/* ==========================================================================
   SISTEMA DE GESTAO VISUAL 3D - RUAS E RAMPAS REALDEC
   Tema: Industrial Claro / Padrao Apple e Linear
   ========================================================================== */

:root {
  /* Tema Claro (Padrao Ativo) */
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.90);
  --bg-interactive: rgba(15, 23, 42, 0.04);
  --bg-interactive-hover: rgba(15, 23, 42, 0.08);

  --border-subtle: rgba(15, 23, 42, 0.10);
  --border-light: rgba(15, 23, 42, 0.16);
  --border-active: rgba(2, 132, 199, 0.60);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --color-brand: #0284c7;
  --color-brand-light: #0369a1;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-purple: #7c3aed;

  --status-ok: #16a34a;
  --status-warning: #d97706;
  --status-error: #dc2626;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.14);
  --shadow-glow-red: 0 0 16px rgba(220, 38, 38, 0.25);
  --shadow-glow-blue: 0 0 16px rgba(2, 132, 199, 0.25);

  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg-primary: #0b0f17;
  --bg-secondary: #131a26;
  --bg-tertiary: #1a2333;
  --bg-card: rgba(19, 26, 38, 0.85);
  --bg-card-hover: rgba(26, 35, 51, 0.95);
  --bg-glass: rgba(15, 23, 42, 0.78);
  --bg-interactive: rgba(255, 255, 255, 0.06);
  --bg-interactive-hover: rgba(255, 255, 255, 0.12);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.15);
  --border-active: rgba(56, 189, 248, 0.45);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --color-brand: #0284c7;
  --color-brand-light: #38bdf8;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-purple: #8b5cf6;

  --status-ok: #10b981;
  --status-warning: #f59e0b;
  --status-error: #ef4444;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow-red: 0 0 20px rgba(239, 68, 68, 0.5);
  --shadow-glow-blue: 0 0 20px rgba(56, 189, 248, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  user-select: none;
}

/* Container do Canvas 3D */
#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ==========================================================================
   HEADER E BARRA SUPERIOR
   ========================================================================== */
.top-navbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-badge {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.6px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-glow-blue);
}

.brand-info h1 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.brand-info p {
  font-size: 10px;
  color: var(--text-muted);
}

/* KPI Badges no Topo */
.kpi-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-interactive);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.kpi-card strong {
  font-size: 14px;
  color: var(--text-main);
  font-weight: 700;
}

.kpi-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-green { background: var(--status-ok); box-shadow: 0 0 8px var(--status-ok); }
.dot-yellow { background: var(--status-warning); box-shadow: 0 0 8px var(--status-warning); }
.dot-red { 
  background: var(--status-error); 
  box-shadow: 0 0 8px var(--status-error); 
  animation: pulseAnimation 1.5s infinite;
}

@keyframes pulseAnimation {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

/* Botoes de Acao Superior */
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon-text {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-interactive);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon-text:hover {
  background: var(--bg-interactive-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.btn-icon-text:active {
  transform: scale(0.98);
}

.btn-primary-action {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1px solid rgba(2, 132, 199, 0.4);
  box-shadow: var(--shadow-sm);
}

.btn-primary-action:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  color: #ffffff;
  box-shadow: var(--shadow-glow-blue);
}

.badge-count {
  background: var(--color-danger);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 2px;
}

/* ==========================================================================
   BARRA LATERAL DE FILTROS E CONTROLE DE CAMERA
   ========================================================================== */
.controls-sidebar {
  position: absolute;
  top: 86px;
  left: 16px;
  z-index: 15;
  width: 280px;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  pointer-events: auto;
}

.controls-sidebar::-webkit-scrollbar {
  width: 4px;
}
.controls-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Campo de Busca */
.search-box {
  position: relative;
  width: 100%;
}

.search-box input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px 8px 34px;
  font-size: 12px;
  color: var(--text-main);
  outline: none;
  transition: var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

/* Botoes de Presets de Camera */
.camera-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.camera-grid .btn-full {
  grid-column: span 2;
}

/* Titulos de Categorias de Camera */
.camera-category-title {
  grid-column: span 2;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-brand);
  padding: 8px 4px 4px 4px;
  border-bottom: 1px solid var(--border-subtle);
  margin-top: 6px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.camera-category-title:first-child {
  margin-top: 0;
  padding-top: 2px;
}

.camera-category-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-brand);
  box-shadow: 0 0 6px rgba(2, 132, 199, 0.6);
}

.camera-btn {
  background: var(--bg-interactive);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.camera-btn:hover {
  background: var(--bg-interactive-hover);
  color: var(--text-main);
  border-color: var(--border-light);
}

.camera-btn.active {
  background: rgba(2, 132, 199, 0.12);
  border-color: var(--color-brand);
  color: var(--color-brand);
}

/* Arvore de Cameras dos Motores (Ruas 1 a 4) */
.motor-camera-tree {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.tree-street-node {
  background: var(--bg-interactive);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition-fast);
}

.tree-street-node[open] {
  border-color: rgba(2, 132, 199, 0.4);
  background: var(--bg-secondary);
}

.tree-street-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  cursor: pointer;
  user-select: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  outline: none;
  transition: var(--transition-fast);
}

.tree-street-summary:hover {
  color: var(--color-brand);
}

.tree-street-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tree-street-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: 8px;
}

.tree-motor-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px 8px 10px 8px;
  background: rgba(0, 0, 0, 0.02);
  border-top: 1px solid var(--border-subtle);
}

.motor-tree-btn {
  padding: 5px 2px;
  font-size: 10px;
  font-weight: 700;
  font-family: monospace;
  text-align: center;
  border-radius: 4px;
}

/* Filtros por Rua */
.filter-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-interactive);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 11px;
  color: var(--text-muted);
}

.filter-item:hover {
  background: var(--bg-interactive-hover);
  color: var(--text-main);
}

.filter-item.active {
  background: rgba(2, 132, 199, 0.12);
  border-color: var(--color-brand);
  color: var(--text-main);
}

.filter-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-tag {
  font-size: 10px;
  background: var(--bg-interactive-hover);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Interruptores / Toggles */
.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-light);
  transition: 0.3s;
  border-radius: 20px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--color-brand);
}

input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

/* ==========================================================================
   LEGENDA E ORIENTACAO VISUAL NO RODAPE
   ========================================================================== */
.bottom-legend {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 15;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mouse-instructions {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 15;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

/* ==========================================================================
   TOOLTIP 3D FLUTUANTE (HUD)
   ========================================================================== */
#hud-tooltip {
  position: absolute;
  z-index: 30;
  background: var(--bg-secondary);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  display: none;
  transform: translate(-50%, -120%);
  min-width: 190px;
}

.hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 8px;
}

.hud-tag {
  font-size: 12px;
  font-weight: 800;
  color: var(--color-brand);
  letter-spacing: 0.5px;
}

.hud-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.hud-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.hud-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   DRAWER LATERAL DE DETALHES DO EQUIPAMENTO SELECIONADO
   ========================================================================== */
.equipment-drawer {
  position: absolute;
  top: 86px;
  right: 16px;
  width: 360px;
  max-height: calc(100vh - 110px);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  z-index: 25;
  display: none;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  pointer-events: auto;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.equipment-drawer.active {
  display: flex;
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.drawer-tag {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-brand);
  letter-spacing: -0.2px;
}

.drawer-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.drawer-close {
  background: var(--bg-interactive);
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.drawer-close:hover {
  background: var(--bg-interactive-hover);
  color: var(--text-main);
}

/* Status Atual e Seletor Rapido */
.status-pill-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-pill-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.status-buttons-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.btn-status-quick {
  background: var(--bg-interactive);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: var(--transition-fast);
}

.btn-status-quick:hover {
  border-color: var(--border-light);
  color: var(--text-main);
}

.btn-status-quick.active-ok {
  background: rgba(22, 163, 74, 0.15);
  border-color: var(--status-ok);
  color: var(--status-ok);
}

.btn-status-quick.active-warn {
  background: rgba(217, 119, 6, 0.15);
  border-color: var(--status-warning);
  color: var(--status-warning);
}

.btn-status-quick.active-err {
  background: rgba(220, 38, 38, 0.15);
  border-color: var(--status-error);
  color: var(--status-error);
}

/* Grade de Telemetria e Sensores */
.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.telemetry-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.telemetry-label {
  font-size: 11px;
  color: var(--text-dim);
}

.telemetry-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.telemetry-bar-wrap {
  width: 100%;
  height: 4px;
  background: var(--bg-interactive-hover);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.telemetry-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Especificacoes Mecanicas */
.specs-list {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.specs-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.specs-row:last-child {
  border-bottom: none;
}

.specs-label {
  color: var(--text-dim);
  flex: 0 0 115px;
  font-weight: 500;
  word-break: break-word;
}

.specs-val {
  color: var(--text-main);
  font-weight: 600;
  text-align: right;
  flex: 1;
  word-break: break-word;
}

/* Botoes de Acao do Drawer */
.drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.btn-os-open {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border: 1px solid rgba(220, 38, 38, 0.6);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
  transition: var(--transition-fast);
}

.btn-os-open:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
}

.btn-view-history {
  background: var(--bg-interactive);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
}

.btn-view-history:hover {
  background: var(--bg-interactive-hover);
  color: var(--text-main);
}

/* ==========================================================================
   MODAL DE ABERTURA DE O.S. (ORDEM DE SERVICO)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 18px 24px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-wrap h2 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
}

.modal-title-wrap p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-control {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  font-family: inherit;
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

.modal-footer {
  padding: 16px 24px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.btn-secondary {
  background: var(--bg-interactive);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-interactive-hover);
  color: var(--text-main);
}

.btn-submit-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: 1px solid rgba(220, 38, 38, 0.6);
  border-radius: var(--radius-md);
  padding: 10px 22px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.btn-submit-danger:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow-red);
}

/* ==========================================================================
   DRAWER DE LISTAGEM DE TODAS AS O.S. ATIVAS
   ========================================================================== */
.os-list-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  z-index: 90;
  display: none;
  flex-direction: column;
  animation: drawerSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes drawerSlide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.os-list-drawer.active {
  display: flex;
}

.os-drawer-header {
  padding: 20px 24px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.os-drawer-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.os-item-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition-fast);
}

.os-item-card:hover {
  border-color: var(--border-light);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.os-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.os-number {
  font-size: 13px;
  font-weight: 800;
  color: var(--color-brand);
}

.os-tag-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-interactive-hover);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-main);
}

.os-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.os-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--text-dim);
}

.os-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

.btn-os-locate {
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.3);
  color: var(--color-brand);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-os-locate:hover {
  background: rgba(2, 132, 199, 0.2);
}

.btn-os-resolve {
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.3);
  color: var(--status-ok);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-os-resolve:hover {
  background: rgba(22, 163, 74, 0.2);
}

.btn-os-print-item {
  background: var(--bg-interactive);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 11px;
  cursor: pointer;
  margin-left: auto;
}

.btn-os-print-item:hover {
  background: var(--bg-interactive-hover);
  color: var(--text-main);
}

/* ==========================================================================
   MODAL DE IMPRESSAO DE ORDEM DE SERVICO (RELATORIO OFICIAL)
   ========================================================================== */
#print-os-container {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }
  #print-os-container, #print-os-container * {
    visibility: visible;
  }
  #print-os-container {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: #ffffff;
    color: #000000;
    padding: 24px;
    font-family: Arial, sans-serif;
  }
}

.print-sheet {
  max-width: 800px;
  margin: 0 auto;
  border: 2px solid #000;
  padding: 20px;
  background: #fff;
  color: #000;
}

.print-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #000;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.print-sheet-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.print-sheet-table td, .print-sheet-table th {
  border: 1px solid #333;
  padding: 8px 10px;
  font-size: 12px;
}

.print-sheet-table th {
  background: #f0f0f0;
  text-align: left;
}

.print-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 10px;
}

.sig-line {
  width: 45%;
  border-top: 1px solid #000;
  text-align: center;
  font-size: 11px;
  padding-top: 4px;
}

/* ==========================================================================
   MODAL DE FOTOS E REFERENCIAS DO GALPAO
   ========================================================================== */
.photos-grid-modal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.photo-card-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
}

.photo-card-item img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.photo-caption {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   COMPONENTES MOBILE E ADAPTATIVOS
   ========================================================================== */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.50);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 38;
  display: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
  pointer-events: auto;
}

body.sidebar-open-mobile .sidebar-backdrop {
  display: block;
  opacity: 1;
}

.sidebar-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}

.sidebar-mobile-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-sidebar-mobile-close {
  background: var(--bg-interactive);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-sidebar-mobile-close:hover {
  background: var(--bg-interactive-hover);
}

.drawer-drag-handle {
  display: none;
  width: 44px;
  height: 5px;
  border-radius: 4px;
  background: var(--border-light);
  margin: 0 auto 10px auto;
}

/* ==========================================================================
   RESPONSIVIDADE: TABLETS E DISPOSITIVOS INTERMEDIARIOS (max-width: 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .top-navbar {
    top: 10px;
    left: 10px;
    right: 10px;
    padding: 8px 12px;
    gap: 8px;
  }

  .brand-info h1 {
    font-size: 13px;
  }

  .brand-info p {
    font-size: 9px;
  }

  .kpi-container {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
    padding: 2px 0;
  }
  .kpi-container::-webkit-scrollbar {
    display: none;
  }

  .top-actions {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
    padding: 2px 0;
  }
  .top-actions::-webkit-scrollbar {
    display: none;
  }

  .btn-icon-text {
    padding: 7px 11px;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .erp-status-indicator {
    padding: 5px 9px;
    font-size: 10px;
    flex-shrink: 0;
  }

  .btn-toggle-sidebar {
    display: flex !important;
    top: 86px;
    left: 10px;
  }

  .controls-sidebar {
    top: 86px;
    left: 10px;
    width: 260px;
    max-height: calc(100vh - 100px);
  }

  .equipment-drawer {
    top: 86px;
    right: 10px;
    width: 320px;
    max-height: calc(100vh - 100px);
  }

  .os-list-drawer {
    width: min(440px, 90vw);
  }

  .mouse-instructions {
    display: none;
  }
}

/* ==========================================================================
   RESPONSIVIDADE: SMARTPHONES E TELAS PEQUENAS (max-width: 767px)
   ========================================================================== */
@media (max-width: 767px) {
  /* Barra Superior Fixa e Compacta */
  .top-navbar {
    top: 6px;
    left: 6px;
    right: 6px;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    box-shadow: var(--shadow-sm);
  }

  .brand-section {
    justify-content: space-between;
    width: 100%;
  }

  .brand-logo-badge {
    font-size: 11px;
    padding: 4px 8px;
  }

  .brand-info h1 {
    font-size: 12px;
  }

  .brand-info p {
    display: none;
  }

  /* KPIs em carrossel horizontal deslizavel */
  .kpi-container {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 5px;
    padding: 2px 0;
  }
  .kpi-container::-webkit-scrollbar {
    display: none;
  }

  .kpi-card {
    padding: 3px 7px;
    font-size: 10px;
    flex-shrink: 0;
  }

  .kpi-card strong {
    font-size: 12px;
  }

  /* Acoes superiores em carrossel horizontal de facil alcance */
  .top-actions {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding: 2px 0;
  }
  .top-actions::-webkit-scrollbar {
    display: none;
  }

  .btn-icon-text {
    padding: 6px 10px;
    font-size: 11px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
  }

  .erp-status-indicator {
    padding: 4px 8px;
    font-size: 10px;
    flex-shrink: 0;
  }

  /* Botao Flutuante Redondo para Acesso Rapido as Cameras e Filtros */
  .btn-toggle-sidebar {
    display: flex !important;
    position: fixed;
    top: auto;
    bottom: 18px;
    left: 14px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1.5px solid var(--color-brand);
    color: var(--color-brand);
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
    z-index: 40;
  }

  .btn-toggle-sidebar svg {
    width: 20px;
    height: 20px;
  }

  /* Sidebar vira gaveta Off-Canvas lateral com fundo escurecido */
  .controls-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 86vw);
    height: 100vh;
    max-height: 100vh;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    padding: 16px;
    z-index: 50;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.35);
    transform: translateX(-110%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  body.sidebar-open-mobile .controls-sidebar {
    transform: translateX(0);
  }

  body.sidebar-collapsed .controls-sidebar {
    transform: translateX(-110%);
  }

  .sidebar-mobile-header {
    display: flex;
  }

  /* Drawer de Equipamento vira Bottom Sheet deslizante inferior */
  .drawer-drag-handle {
    display: block;
  }

  .equipment-drawer {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 80vh;
    border-radius: 20px 20px 0 0;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 60;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
    animation: bottomSheetSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes bottomSheetSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .drawer-tag {
    font-size: 16px;
  }

  .drawer-subtitle {
    font-size: 11px;
  }

  /* Drawers de Listagens ocupam tela cheia no celular */
  .os-list-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    z-index: 95;
    border-left: none;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .os-drawer-header {
    padding: 14px 16px;
  }

  .os-drawer-body {
    padding: 14px 16px;
  }

  /* Modais Adaptados para Mobile */
  .modal-overlay {
    padding: 8px;
    align-items: flex-end;
  }

  .modal-dialog {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    margin: 0;
    border-radius: 18px 18px 0 0;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-title-wrap h2 {
    font-size: 15px;
  }

  .modal-body {
    padding: 16px;
    gap: 12px;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .form-control,
  select.form-control,
  textarea.form-control {
    font-size: 16px !important;
    padding: 10px 12px;
  }

  .modal-footer {
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer button {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .photos-grid {
    grid-template-columns: 1fr !important;
  }

  .toast {
    bottom: 74px;
    right: 14px;
    left: 14px;
    max-width: none;
    font-size: 12px;
  }
}

/* ==========================================================================
   MODELOS DE CORRENTE: ASA 40 E DIN 8187
   ========================================================================== */
.chain-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 4px;
}

.chain-filter-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-interactive);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.chain-filter-btn small {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-dim);
  margin-top: 2px;
}

.chain-filter-btn:hover {
  background: var(--bg-interactive-hover);
  border-color: var(--border-active);
}

.chain-filter-btn.active {
  background: rgba(2, 132, 199, 0.12);
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.dot-chain {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-bottom: 4px;
}

.dot-chain-asa {
  background: #0284c7;
  box-shadow: 0 0 6px rgba(2, 132, 199, 0.7);
}

.dot-chain-din {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.7);
}

/* Badges de Corrente no Drawer */
.chain-spec-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  margin-bottom: 6px;
}

.chain-spec-badge.badge-asa {
  background: rgba(2, 132, 199, 0.12);
  border: 1px solid rgba(2, 132, 199, 0.35);
  color: #0369a1;
}

[data-theme="dark"] .chain-spec-badge.badge-asa {
  background: rgba(2, 132, 199, 0.20);
  color: #38bdf8;
}

.chain-spec-badge.badge-din {
  background: rgba(217, 119, 6, 0.12);
  border: 1px solid rgba(217, 119, 6, 0.35);
  color: #b45309;
}

[data-theme="dark"] .chain-spec-badge.badge-din {
  background: rgba(245, 158, 11, 0.20);
  color: #fbbf24;
}

.chain-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-asa .chain-badge-dot {
  background: #0284c7;
}

.badge-din .chain-badge-dot {
  background: #f59e0b;
}

.chain-badge-text {
  display: flex;
  flex-direction: column;
}

.chain-warning-note {
  font-size: 10px;
  line-height: 1.35;
  color: var(--text-dim);
  background: var(--bg-interactive);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-warning);
}

/* ==========================================================================
   BOTAO FLUTUANTE DE RECOLHER / EXPANDIR SIDEBAR
   ========================================================================== */
.btn-toggle-sidebar {
  position: fixed;
  top: 86px;
  left: 16px;
  z-index: 18;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  display: none; /* Ativado via media query ou modo aba */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.btn-toggle-sidebar:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}

body.sidebar-collapsed .controls-sidebar {
  transform: translateX(-110%);
  pointer-events: none;
}

body.sidebar-collapsed .btn-toggle-sidebar {
  left: 16px;
}

/* ==========================================================================
   MODO ABA EMBARCADA (INTEGRACAO ERP)
   ========================================================================== */
body.embed-mode {
  overflow: hidden;
}

body.embed-mode .top-navbar {
  padding: 6px 14px;
  min-height: 52px;
}

body.embed-mode .brand-info p {
  display: none;
}

body.embed-mode .btn-toggle-sidebar {
  display: flex;
}

body.embed-mode.sidebar-collapsed .controls-sidebar {
  transform: translateX(-110%);
}

body.embed-mode .controls-sidebar {
  top: 72px;
  bottom: 12px;
  transition: transform var(--transition-normal);
}

body.header-hidden .top-navbar {
  display: none !important;
}

body.header-hidden .controls-sidebar {
  top: 14px;
}

body.header-hidden .btn-toggle-sidebar {
  top: 14px;
  display: flex;
}

body.sidebar-hidden .controls-sidebar,
body.sidebar-hidden .btn-toggle-sidebar {
  display: none !important;
}

/* ==========================================================================
   INTEGRACAO COM ERP COOLMAY, ATENDIMENTOS E FECHAMENTO DE O.S.
   ========================================================================== */
.erp-status-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.4px;
}

.erp-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: erpPulse 2s infinite ease-in-out;
}

@keyframes erpPulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

.btn-service-action {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff !important;
  border: 1px solid rgba(2, 132, 199, 0.6);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.btn-service-action:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.45);
  transform: translateY(-1px);
}

.btn-ticket-open {
  background: rgba(2, 132, 199, 0.08);
  color: var(--color-brand);
  border: 1px solid var(--color-brand);
  border-radius: var(--radius-md);
  padding: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.btn-ticket-open:hover {
  background: rgba(2, 132, 199, 0.16);
  color: #ffffff;
}

.btn-os-resolve {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 1px solid rgba(16, 185, 129, 0.6);
  border-radius: var(--radius-md);
  padding: 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transition: var(--transition-fast);
}

.btn-os-resolve:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.badge-ticket-count {
  background: #0284c7 !important;
}

.ticket-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  transition: var(--transition-fast);
}

.ticket-card:hover {
  border-color: var(--color-brand);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.ticket-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ticket-id {
  font-weight: 800;
  font-size: 13px;
  color: var(--color-brand);
}

.ticket-priority-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.ticket-p-critica { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.4); }
.ticket-p-alta { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.4); }
.ticket-p-media { background: rgba(59, 130, 246, 0.2); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.4); }
.ticket-p-baixa { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.4); }

.ticket-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.ticket-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 10px;
}

.ticket-meta {
  font-size: 11px;
  color: var(--text-subtle);
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

