/**
 * SGM MANUTCONTROL V2 — DESIGN SYSTEM OFICIAL NEXOAC (TEMA CLARO CLEAN)
 * Paleta Oficial:
 * - Azul Marinho Corporativo: #0B3B60
 * - Laranja Vibrante: #F37A1F
 * - Fundo Claro e Suave: #F8FAFC (Slate-50) e #FFFFFF
 */

:root {
  --primary: #0B3B60;
  --primary-hover: #082A45;
  --primary-light: #E8F0F7;
  --accent: #F37A1F;
  --accent-hover: #D96510;
  --accent-light: #FFF2E8;

  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --border-color: #E2E8F0;
  --border-light: #F1F5F9;

  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;

  --success: #10B981;
  --success-bg: #ECFDF5;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;

  --sidebar-width: 260px;
  --sidebar-collapsed-width: 76px;
  --topbar-height: 64px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Layout Principal com Sidebar */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ======================================================== */
/* SIDEBAR RETRÁTIL NEXOAC                                  */
/* ======================================================== */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: #FFFFFF;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 150;
  box-shadow: var(--shadow-sm);
}

.app-layout.collapsed .app-sidebar {
  width: var(--sidebar-collapsed-width);
}

/* Cabeçalho da Sidebar */
.sidebar-header {
  height: var(--topbar-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.sidebar-brand-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.sidebar-logo-img {
  height: 38px;
  width: auto;
  max-width: 145px;
  object-fit: contain;
  display: block;
  transition: all 0.2s ease;
}

.sidebar-logo-icon-img {
  height: 38px;
  width: auto;
  max-width: 52px;
  object-fit: contain;
  display: none;
}

.app-layout.collapsed .sidebar-header {
  padding: 0 8px;
  justify-content: center;
  align-items: center;
}

.app-layout.collapsed .sidebar-brand-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  overflow: visible;
  cursor: pointer;
}

.app-layout.collapsed .sidebar-logo-img {
  display: none;
}

.app-layout.collapsed .sidebar-logo-icon-img {
  display: block;
  margin: 0 auto;
  height: 38px;
  width: auto;
  max-width: 54px;
}

.app-layout.collapsed .sidebar-title-compact {
  display: none;
}

.app-layout.collapsed .btn-toggle-sidebar {
  position: absolute;
  right: -13px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  cursor: pointer;
}

.app-layout.collapsed .btn-toggle-sidebar:hover {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}

.brand-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-toggle-sidebar {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}

.btn-toggle-sidebar:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.app-layout.collapsed .toggle-icon {
  transform: rotate(180deg);
}

/* Menu de Navegação */
.sidebar-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
}

.nav-item:hover {
  background-color: var(--border-light);
  color: var(--primary);
}

.nav-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.nav-icon {
  font-size: 1.2rem;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-label {
  flex: 1;
  transition: opacity 0.2s;
}

.app-layout.collapsed .nav-label,
.app-layout.collapsed .nav-badge {
  display: none;
}

.nav-badge {
  background: var(--border-color);
  color: var(--text-main);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.nav-badge.accent {
  background: var(--accent);
  color: #fff;
}

/* Rodapé da Sidebar */
.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.supabase-status-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.2s;
}

.supabase-status-btn:hover {
  border-color: var(--primary);
}

.app-layout.collapsed .supabase-status-info {
  display: none;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94A3B8;
  flex-shrink: 0;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-dot.offline {
  background: var(--warning);
}

.supabase-status-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.status-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.status-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.user-avatar:hover {
  background: var(--accent);
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.app-layout.collapsed .sidebar-footer {
  padding: 12px 6px;
  align-items: center;
}

.app-layout.collapsed .user-profile-pill {
  justify-content: center;
  padding: 4px 0;
}

.app-layout.collapsed .user-avatar {
  margin: 0 auto;
}

.app-layout.collapsed .user-info {
  display: none;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-role-select {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.68rem;
  color: var(--primary);
  font-weight: 700;
  padding: 3px 6px;
  margin-top: 3px;
  cursor: pointer;
  outline: none;
  width: 100%;
  max-width: 175px;
  transition: border-color 0.2s;
}

.user-role-select:focus {
  border-color: var(--accent);
}

.topbar-profile-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  transition: all 0.2s ease;
}

.topbar-profile-tag.role-pcm {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #BFDBFE;
}

.topbar-profile-tag.role-tech {
  background: #FEF3C7;
  color: #B45309;
  border-color: #FDE68A;
}

.topbar-profile-tag.role-operator {
  background: #E0E7FF;
  color: #4338CA;
  border-color: #C7D2FE;
}

/* ======================================================== */
/* ÁREA PRINCIPAL (APP MAIN CONTENT)                        */
/* ======================================================== */
.app-main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-layout.collapsed .app-main-content {
  margin-left: var(--sidebar-collapsed-width);
}

/* Topbar Superior Limpa */
.app-topbar {
  height: var(--topbar-height);
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-mobile-menu {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 1.1rem;
  cursor: pointer;
}

.breadcrumb-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb-project {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.breadcrumb-separator {
  color: var(--text-light);
}

.view-header-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-quick-qr {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  color: var(--primary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-quick-qr:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

/* Botões Padrão */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--border-light);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.78rem;
}

/* ======================================================== */
/* VIEWS WRAPPER & PAINÉIS                                  */
/* ======================================================== */
.views-viewport {
  padding: 24px 28px;
  flex: 1;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

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

/* KPI Summary Strip (Métricas Limpas em 1 Linha) */
.kpi-summary-strip {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 16px;
}

.kpi-strip-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.kpi-strip-label {
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-strip-val {
  color: var(--primary);
  font-weight: 800;
}

.kpi-strip-val.accent {
  color: var(--accent);
}

.kpi-strip-val.danger {
  color: var(--danger);
}

/* Toolbar da View de Ordens */
.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.filter-tab {
  background: transparent;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab:hover {
  color: var(--primary);
}

.filter-tab.active {
  background: var(--primary);
  color: #FFFFFF;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-input {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  width: 280px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
}

/* Seletor de Modo: Cartões vs Linhas */
.view-mode-selector {
  display: flex;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  padding: 3px;
  border-radius: var(--radius-md);
  gap: 3px;
}

.btn-toggle-view {
  background: transparent;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-toggle-view:hover {
  color: var(--primary);
  background: var(--bg-main);
}

.btn-toggle-view.active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

/* ======================================================== */
/* BANNER SCANNER QR CODE & URGÊNCIA — MODAL OS CORRETIVA (V8) */
/* ======================================================== */
.os-qr-scan-banner {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.urgency-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  background: #FFFFFF;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.78rem;
  line-height: 1.3;
  color: #334155;
}
.urgency-btn:hover { border-color: #94A3B8; background: #F8FAFC; }
.urgency-btn small { color: #64748B; }

.urgency-btn.selected { font-weight: 700; }
.urgency-p0.selected { border-color: #EF4444; background: #FEF2F2; color: #991B1B; }
.urgency-p1.selected { border-color: #F59E0B; background: #FFFBEB; color: #92400E; }
.urgency-p2.selected { border-color: #22C55E; background: #F0FDF4; color: #166534; }

.urgency-p0:hover { border-color: #FCA5A5; }
.urgency-p1:hover { border-color: #FCD34D; }
.urgency-p2:hover { border-color: #86EFAC; }

/* ======================================================== */
/* CARDS DE ORDENS DE SERVIÇO (DINÂMICOS E ALINHADOS)       */
/* ======================================================== */
.orders-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.os-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 420px;
  gap: 12px;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}

.os-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.os-card.critical-p0 {
  border-left: 4px solid var(--danger);
}

.os-card.in-progress {
  border-left: 4px solid var(--accent);
}

.os-card.completed {
  border-left: 4px solid var(--success);
}

.os-card.preventive-type {
  border-left: 4px solid var(--primary);
}

.os-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.os-code-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

.badge-status {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-status.aberta { background: #FEF3C7; color: #92400E; }
.badge-status.em-execucao { background: #FFEDD5; color: #C2410C; animation: pulse 2s infinite; }
.badge-status.concluida { background: #D1FAE5; color: #065F46; }

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.75; }
  100% { opacity: 1; }
}

.os-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.os-equip-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
  line-height: 1.3;
}

.os-equip-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.os-scope-text {
  font-size: 0.83rem;
  color: #334155;
  background: var(--bg-main);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  line-height: 1.45;
  min-height: 52px;
  border: 1px solid var(--border-light);
}

.os-active-session-box {
  background: #FFF7ED;
  border: 1px solid #FFEDD5;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #9A3412;
  line-height: 1.4;
}

.checklist-progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(11, 59, 96, 0.15);
}

.checklist-progress-pill:hover {
  background: #0B3B60;
  color: #FFFFFF;
}

.os-indicators-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.os-indicators-row strong {
  color: var(--text-main);
}

.os-action-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--border-light);
  min-height: 44px;
}

.os-action-footer .btn-sm {
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 600;
}

/* ======================================================== */
/* MODO LINHAS / TABELA CORPORATIVA DE OS                   */
/* ======================================================== */
.orders-list-table-wrap {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.orders-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.orders-list-table thead th {
  background: var(--bg-main);
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.orders-list-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}

.orders-list-table tbody tr:hover {
  background: #F8FAFC;
}

.orders-list-table tbody tr.p0-row {
  background: #FEF2F2;
}

.orders-list-table tbody td {
  padding: 12px 16px;
  vertical-align: middle;
}

.table-code-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.table-code {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
}

.table-type {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.table-equip-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.table-equip-name {
  font-weight: 700;
  color: var(--text-main);
}

.table-equip-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.table-scope-text {
  max-width: 320px;
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.35;
}

.table-actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

/* ======================================================== */
/* LEITOR DE QR CODE (VIEW 2)                               */
/* ======================================================== */
.qr-container-clean {
  max-width: 650px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.qr-camera-card, .qr-result-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.qr-card-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.qr-card-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.qr-viewport-area {
  width: 100%;
  min-height: 260px;
  background: #0F172A;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
}

.qr-camera-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.qr-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: var(--text-light);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.qr-divider::before, .qr-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.qr-divider span {
  padding: 0 12px;
}

.form-row-inline {
  display: flex;
  gap: 10px;
}

.badge-tag-qr {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.qr-result-header h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.qr-result-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.qr-options-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.qr-options-box h5 {
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 12px;
}

.qr-action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-action-qr {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-action-qr:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-action-qr.primary:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.btn-action-qr.alert:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.btn-action-qr strong {
  font-size: 0.9rem;
  color: var(--primary);
}

.btn-action-qr span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ======================================================== */
/* PROGRAMAÇÃO PCM & PREVENTIVAS (VIEWS 3 E 4)              */
/* ======================================================== */
.schedule-view-header, .preventive-view-header, .assets-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.schedule-capacity-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.capacity-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.capacity-card.highlight {
  border-color: var(--accent);
  background: #FFFDF9;
}

.cap-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.cap-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.capacity-card.highlight .cap-value {
  color: var(--accent);
}

.cap-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.schedule-table-wrap {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.schedule-table th {
  background: var(--bg-main);
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.schedule-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
}

.status-badge {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
}

.status-badge.running { background: #FFEDD5; color: #C2410C; }
.status-badge.open { background: var(--primary-light); color: var(--primary); }

/* Preventivas Grid */
.preventive-plans-grid, .assets-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.plan-card, .asset-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.plan-card-header, .asset-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* ======================================================== */
/* MODAIS & FORMULÁRIOS CLEAN                              */
/* ======================================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(10px);
  transition: transform 0.2s ease;
  overflow: hidden;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

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

.modal-title-wrap h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
}

.modal-subtitle {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

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

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
}

.modal-card.modal-lg {
  max-width: 780px;
}

/* ======================================================== */
/* CHECKLIST PREVENTIVO & PLANOS MESTRES                    */
/* ======================================================== */
.preventive-plan-info-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  background: var(--primary-light);
  border: 1px solid rgba(11, 59, 96, 0.15);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--primary);
  margin-bottom: 14px;
}

.preventive-plan-info-strip span {
  color: var(--text-muted);
}

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

.checklist-badge-count {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.preventive-checklist-box {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-height: 280px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-item-card {
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
}

.checklist-item-card.answered-c {
  border-left: 3px solid var(--success);
  background: #F0FDF4;
}

.checklist-item-card.answered-nc {
  border-left: 3px solid var(--danger);
  background: #FEF2F2;
}

.checklist-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.checklist-item-discipline {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.disc-visual { background: #E0F2FE; color: #0369A1; }
.disc-operacional { background: #FEF3C7; color: #B45309; }
.disc-mecanica { background: #FFEDD5; color: #C2410C; }
.disc-eletrica { background: #EDE9FE; color: #6D28D9; }

.checklist-item-desc {
  font-size: 0.83rem;
  color: var(--text-main);
  font-weight: 500;
}

.checklist-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.btn-check-option {
  border: 1px solid var(--border-color);
  background: #FFFFFF;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-check-option:hover {
  border-color: var(--text-muted);
}

.btn-check-option.active-c {
  background: var(--success);
  color: #FFFFFF;
  border-color: var(--success);
}

.btn-check-option.active-nc {
  background: var(--danger);
  color: #FFFFFF;
  border-color: var(--danger);
}

.btn-check-option.active-na {
  background: #64748B;
  color: #FFFFFF;
  border-color: #64748B;
}

.checklist-nc-input {
  margin-top: 6px;
  font-size: 0.8rem;
  padding: 6px 10px;
  border: 1px solid #FECACA;
  border-radius: var(--radius-sm);
  background: #FFF;
  width: 100%;
}

/* ======================================================== */
/* VIEW DO PROCEDIMENTO OPERACIONAL PADRÃO (POP)            */
/* ======================================================== */
.pop-view-container {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 1100px;
  margin: 0 auto;
}

.pop-header-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.pop-header-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.pop-brand-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.pop-doc-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.pop-header-meta h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 2px;
}

.pop-header-meta p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pop-header-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.pop-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.pop-badge.approved { background: #DCFCE7; color: #15803D; }
.pop-badge.nexo { background: var(--primary-light); color: var(--primary); }
.pop-badge.ms { background: #FFEDD5; color: #C2410C; }

.pop-grid-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 800px) {
  .pop-grid-row { grid-template-columns: 1fr; }
}

.pop-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}

.pop-card.full-width {
  grid-column: 1 / -1;
}

.pop-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 10px;
}

.pop-step-num {
  font-size: 1.3rem;
}

.pop-card-title h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
}

.pop-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.86rem;
  color: #334155;
  line-height: 1.5;
}

.pop-list li strong {
  color: var(--primary);
}

.pop-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.pop-table th {
  background: var(--bg-main);
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

.pop-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
}

.pop-phases-wrapper {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pop-section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
}

.pop-phase-card {
  display: flex;
  gap: 16px;
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  align-items: flex-start;
}

.phase-badge {
  background: var(--primary);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.phase-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.phase-content p {
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.45;
  margin-bottom: 4px;
}

.pop-priority-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.prio-box {
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prio-box strong { font-size: 0.92rem; }
.prio-box span { font-size: 0.8rem; color: #475569; }
.prio-box em { font-size: 0.74rem; font-style: normal; font-weight: 700; margin-top: 4px; }

.prio-box.p0 { background: #FEF2F2; border-left: 4px solid var(--danger); }
.prio-box.p0 strong { color: #B91C1C; }
.prio-box.p0 em { color: #991B1B; }

.prio-box.p1 { background: #FFFBEB; border-left: 4px solid var(--warning); }
.prio-box.p1 strong { color: #B45309; }
.prio-box.p1 em { color: #92400E; }

.prio-box.p2 { background: var(--primary-light); border-left: 4px solid var(--primary); }
.prio-box.p2 strong { color: var(--primary); }
.prio-box.p2 em { color: #082A45; }

.prio-box.p3 { background: #F1F5F9; border-left: 4px solid #64748B; }
.prio-box.p3 strong { color: #334155; }
.prio-box.p3 em { color: #475569; }

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #0F172A;
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}

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

/* ======================================================== */
/* RESPONSIVIDADE MOBILE & TABLET                           */
/* ======================================================== */
@media (max-width: 900px) {
  .app-sidebar {
    transform: translateX(-100%);
    width: 260px !important;
  }

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

  .app-main-content {
    margin-left: 0 !important;
  }

  .btn-mobile-menu {
    display: block;
  }

  .btn-toggle-sidebar {
    display: none;
  }

  .schedule-capacity-cards {
    grid-template-columns: 1fr;
  }

  .qr-action-buttons {
    grid-template-columns: 1fr;
  }
}

/* ======================================================== */
/* MAPA ANUAL 52 SEMANAS & PROGRAMAÇÃO PCM (NEXOAC OFICIAL) */
/* ======================================================== */
.schedule-subtabs-nav {
  display: flex;
  gap: 8px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.schedule-subtab-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.schedule-subtab-btn:hover {
  color: var(--primary);
  background: var(--bg-main);
}

.schedule-subtab-btn.active {
  background: var(--primary);
  color: #FFFFFF;
}

.pcm-subpanel {
  display: none;
}

.pcm-subpanel.active {
  display: block;
}

/* Toolbar da Matriz de 52 Semanas */
.matrix-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-card);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.matrix-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.matrix-toolbar-row.sub {
  border-top: 1px dashed var(--border-color);
  padding-top: 10px;
}

.matrix-filter-quarters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.matrix-nav-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-matrix-scroll {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-matrix-scroll:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-matrix-scroll.primary {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.btn-matrix-scroll.primary:hover {
  background: var(--primary-hover);
}

.btn-matrix-sync {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-matrix-sync:hover {
  background: var(--accent);
  color: #FFFFFF;
}

.matrix-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 700;
  transition: all 0.2s;
}

.matrix-role-badge.role-pcm {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.matrix-role-badge.role-tech,
.matrix-role-badge.role-operator {
  background: #FFFBEB;
  color: #D97706;
  border: 1px solid #FDE68A;
}

.quarter-tab {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quarter-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.quarter-tab.active {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}

/* Legenda da Matriz */
.matrix-legend-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.legend-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* Tabela Matricial de 52 Semanas */
.matrix-52-scroll-container {
  overflow-x: auto !important;
  overflow-y: auto;
  max-height: calc(100vh - 280px);
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) #E2E8F0;
  cursor: grab;
}

.matrix-52-scroll-container.grabbing {
  cursor: grabbing;
  user-select: none;
}

.matrix-52-scroll-container::-webkit-scrollbar {
  height: 14px;
  width: 10px;
}

.matrix-52-scroll-container::-webkit-scrollbar-track {
  background: #E2E8F0;
  border-radius: 8px;
  margin: 0 4px;
}

.matrix-52-scroll-container::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 8px;
  border: 2px solid #E2E8F0;
}

.matrix-52-scroll-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.matrix-52-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
}

.matrix-52-table th,
.matrix-52-table td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid #F1F5F9;
  white-space: nowrap;
}

.matrix-52-table th {
  background: #F8FAFC;
  color: var(--primary);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid var(--border-color);
}

/* Colunas Fixas à Esquerda */
.matrix-52-table .sticky-col {
  position: sticky;
  background: #FFFFFF;
  z-index: 5;
  text-align: left;
}

.matrix-52-table th.sticky-col {
  z-index: 15;
  background: #F8FAFC;
}

.matrix-52-table .col-setor {
  left: 0;
  min-width: 120px;
  font-weight: 700;
  color: var(--primary);
  border-right: 1px solid var(--border-color);
}

.matrix-52-table .col-equip {
  left: 120px;
  min-width: 210px;
  font-weight: 600;
  color: var(--text-main);
  border-right: 1px solid var(--border-color);
}

.matrix-52-table .col-tag {
  left: 330px;
  min-width: 95px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
  border-right: 2px solid var(--border-color);
}

.matrix-52-table tr:hover td {
  background-color: #F8FAFC;
}

.matrix-52-table tr:hover td.sticky-col {
  background-color: #F1F5F9;
}

/* Células de Semana Interativas */
.week-cell {
  cursor: pointer;
  transition: background 0.15s ease;
  min-width: 36px;
  height: 36px;
}

.week-cell:hover {
  background-color: #EFF6FF !important;
  outline: 1px solid var(--accent);
}

.week-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.76rem;
  font-family: var(--font-mono);
  user-select: none;
}

/* Cores Oficiais dos Badges */
.status-r, .week-badge.r {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.status-p, .week-badge.p {
  background: #E8F0F7;
  color: var(--primary);
  border: 1px solid #BFDBFE;
}

.status-e, .status-a, .week-badge.e, .week-badge.a {
  background: #FFFBEB;
  color: #D97706;
  border: 1px solid #FDE68A;
}

.status-c, .week-badge.c {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
}

.status-empty, .week-badge.empty {
  color: #CBD5E1;
  font-weight: 400;
  border: 1px dashed #E2E8F0;
}

.matrix-footer-info {
  margin-top: 10px;
  padding: 10px 14px;
  background: #F8FAFC;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid var(--border-color);
}

.matrix-footer-shortcuts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-matrix-quick-jump {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-matrix-quick-jump:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

/* Builder de Checklist no Modal de Edição de Planos */
.edit-checklist-builder {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 12px;
}

.checklist-builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.checklist-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.edit-checklist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.edit-checklist-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  gap: 8px;
}

.edit-checklist-item-desc {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-main);
}

.btn-remove-checkitem {
  background: transparent;
  border: none;
  color: #EF4444;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn-remove-checkitem:hover {
  background: #FEE2E2;
}

/* Painel de Cadastro de Partes / QR Codes */
.parts-add-panel {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--radius-md);
}

.parts-add-panel h5 {
  color: var(--primary);
  font-size: 0.82rem;
  margin-bottom: 4px;
}

/* ======================================================== */
/* NOVOS MESTRES OPERACIONAIS MANUTCONTROL V2               */
/* ======================================================== */

/* Toolbar e Elementos Compartilhados */
.toolbar-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.toolbar-select {
  font-size: 0.82rem;
  padding: 6px 12px;
  min-width: 220px;
  background-color: #FFFFFF;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.header-action-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-breadcrumb {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 2px;
}

.badge-counter-pill {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* ======================================================== */
/* 1. VIEW PARTES DE ATIVOS & EMISSOR DE QR CODES          */
/* ======================================================== */
.parts-qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.part-qr-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.part-qr-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.part-qr-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.part-tag-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: #F1F5F9;
  color: var(--primary);
  border: 1px solid #E2E8F0;
}

.part-family-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent-hover);
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.part-name-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  line-height: 1.3;
}

.part-qr-visual-box {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.qr-canvas-wrapper {
  background: #FFFFFF;
  padding: 8px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 128px;
  min-height: 128px;
}

.qr-canvas-wrapper img, .qr-canvas-wrapper canvas {
  display: block;
}

.qr-code-text-strip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  word-break: break-all;
  text-align: center;
  background: #FFFFFF;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px dashed var(--border-color);
  width: 100%;
}

.part-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
  gap: 8px;
}

.btn-part-action {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

/* ======================================================== */
/* 2. VIEW MODELOS DE CHECKLIST & DISCIPLINAS              */
/* ======================================================== */
.disciplines-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.discipline-metric-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.discipline-metric-card.visual { border-left: 4px solid #0284C7; }
.discipline-metric-card.operacional { border-left: 4px solid #10B981; }
.discipline-metric-card.mecanica { border-left: 4px solid #F37A1F; }
.discipline-metric-card.eletrica { border-left: 4px solid #8B5CF6; }

.metric-icon {
  font-size: 1.8rem;
}

.metric-info {
  display: flex;
  flex-direction: column;
}

.metric-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}

.metric-lbl {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

.checklist-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.checklist-catalog-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s;
}

.checklist-catalog-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

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

.checklist-discipline-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.checklist-discipline-tag.visual { background: #E0F2FE; color: #0369A1; }
.checklist-discipline-tag.operacional { background: #DCFCE7; color: #15803D; }
.checklist-discipline-tag.mecanica { background: var(--accent-light); color: var(--accent-hover); }
.checklist-discipline-tag.eletrica { background: #F3E8FF; color: #7E22CE; }

.checklist-item-code {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-light);
}

.checklist-card-task {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

.checklist-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.method-badge {
  font-size: 0.72rem;
  background: #F1F5F9;
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.crit-badge {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.crit-badge.critica { background: #FEE2E2; color: #B91C1C; }
.crit-badge.monitoramento { background: #FEF3C7; color: #B45309; }
.crit-badge.rotina { background: #ECFDF5; color: #047857; }

.checklist-criteria-box {
  background: #F8FAFC;
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.checklist-criteria-box strong {
  color: var(--primary);
}

.checklist-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
}

/* ======================================================== */
/* 3. VIEW GESTÃO DE EQUIPE & USUÁRIOS                      */
/* ======================================================== */
.team-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.team-metric-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.team-metric-icon {
  font-size: 1.8rem;
}

.team-metric-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  display: block;
}

.team-metric-lbl {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

.user-avatar-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #CBD5E1;
}

.user-info-text {
  display: flex;
  flex-direction: column;
}

.user-full-name {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.88rem;
}

.user-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-role-pcm { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.badge-role-inspector { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.badge-role-maintainer { background: var(--accent-light); color: var(--accent-hover); border: 1px solid #FED7AA; }
.badge-role-operator { background: #F1F5F9; color: #475569; border: 1px solid #CBD5E1; }
.badge-role-manager { background: #FDF2F8; color: #BE185D; border: 1px solid #FBCFE8; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.status-pill.active {
  background: #ECFDF5;
  color: #065F46;
}

.status-pill.active::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
}

.status-pill.inactive {
  background: #FEF2F2;
  color: #991B1B;
}

.status-pill.inactive::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #EF4444;
}

.status-pill.vacation {
  background: #FFFBEB;
  color: #92400E;
}

.status-pill.vacation::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #F59E0B;
}

/* ======================================================== */
/* 4. MODAL E FOLHA DE IMPRESSÃO DE ETIQUETAS QR CODE       */
/* ======================================================== */
.print-instruction-strip {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.8rem;
  color: #1E40AF;
  margin-bottom: 16px;
}

.labels-print-sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  background: #FFFFFF;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-height: 60vh;
  overflow-y: auto;
}

/* Etiqueta Física Industrial Padrão Minas Soldas / NexoAC (70x40mm) */
.etiqueta-fisica-industrial {
  background: #FFFFFF;
  border: 2px solid #0B3B60;
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  page-break-inside: avoid;
  font-family: var(--font-sans);
}

.etiqueta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid #0B3B60;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.etiqueta-brand {
  display: flex;
  align-items: center;
  gap: 6px;
}

.etiqueta-brand-title {
  font-size: 0.65rem;
  font-weight: 800;
  color: #0B3B60;
  text-transform: uppercase;
  line-height: 1;
}

.etiqueta-brand-sub {
  font-size: 0.52rem;
  color: #F37A1F;
  font-weight: 700;
  display: block;
}

.etiqueta-equip-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  background: #0B3B60;
  color: #FFFFFF;
  padding: 2px 6px;
  border-radius: 3px;
}

.etiqueta-body {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.etiqueta-qr-box {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
}

.etiqueta-qr-box canvas, .etiqueta-qr-box img {
  width: 72px !important;
  height: 72px !important;
  display: block;
}

.etiqueta-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.etiqueta-part-name {
  font-size: 0.76rem;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.2;
}

.etiqueta-part-code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: #F37A1F;
}

.etiqueta-equip-name {
  font-size: 0.62rem;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.etiqueta-footer {
  border-top: 1px solid #E2E8F0;
  padding-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.etiqueta-qr-raw {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  color: #64748B;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.etiqueta-hash {
  font-size: 0.5rem;
  font-weight: 700;
  color: #0B3B60;
}

/* Estilos Específicos para Impressão Nativa do Navegador */
@media print {
  body * {
    visibility: hidden;
  }
  #modalPrintLabels, #modalPrintLabels * {
    visibility: visible;
  }
  #modalPrintLabels {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    background: transparent;
    padding: 0;
  }
  .modal-card {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    transform: none !important;
  }
  .modal-header, .modal-footer, .print-instruction-strip, .btn-toggle-sidebar, .sidebar-nav {
    display: none !important;
  }
  .labels-print-sheet {
    max-height: none !important;
    overflow: visible !important;
    border: none !important;
    padding: 0 !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8mm !important;
  }
  .etiqueta-fisica-industrial {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1.5pt solid #000000 !important;
  }
}

/* ======================================================== */
/* 5. TELA DE CONFIGURAÇÕES & LISTAS PADRONIZADAS          */
/* ======================================================== */
.settings-subpanel {
  display: none;
}

.settings-subpanel.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

.settings-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s;
}

.settings-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.table-action-btn-group {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
}

.mini-qr-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFF;
  padding: 4px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.etiqueta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid #0B3B60;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.etiqueta-brand {
  display: flex;
  align-items: center;
  gap: 6px;
}

.etiqueta-brand-title {
  font-size: 0.65rem;
  font-weight: 800;
  color: #0B3B60;
  text-transform: uppercase;
  line-height: 1;
}

.etiqueta-brand-sub {
  font-size: 0.52rem;
  color: #F37A1F;
  font-weight: 700;
  display: block;
}

.etiqueta-equip-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  background: #0B3B60;
  color: #FFFFFF;
  padding: 2px 6px;
  border-radius: 3px;
}

.etiqueta-body {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.etiqueta-qr-box {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
}

.etiqueta-qr-box canvas, .etiqueta-qr-box img {
  width: 72px !important;
  height: 72px !important;
  display: block;
}

.etiqueta-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.etiqueta-part-name {
  font-size: 0.76rem;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.2;
}

.etiqueta-part-code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: #F37A1F;
}

.etiqueta-equip-name {
  font-size: 0.62rem;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.etiqueta-footer {
  border-top: 1px solid #E2E8F0;
  padding-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.etiqueta-qr-raw {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  color: #64748B;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.etiqueta-hash {
  font-size: 0.5rem;
  font-weight: 700;
  color: #0B3B60;
}

/* Estilos Específicos para Impressão Nativa do Navegador */
@media print {
  body * {
    visibility: hidden;
  }
  #modalPrintLabels, #modalPrintLabels * {
    visibility: visible;
  }
  #modalPrintLabels {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    background: transparent;
    padding: 0;
  }
  .modal-card {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    transform: none !important;
  }
  .modal-header, .modal-footer, .print-instruction-strip, .btn-toggle-sidebar, .sidebar-nav {
    display: none !important;
  }
  .labels-print-sheet {
    max-height: none !important;
    overflow: visible !important;
    border: none !important;
    padding: 0 !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8mm !important;
  }
  .etiqueta-fisica-industrial {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1.5pt solid #000000 !important;
  }
}

/* ======================================================== */
/* 5. TELA DE CONFIGURAÇÕES & LISTAS PADRONIZADAS          */
/* ======================================================== */
.settings-subpanel {
  display: none;
}

.settings-subpanel.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

.settings-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s;
}

.settings-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.table-action-btn-group {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
}

.mini-qr-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFF;
  padding: 4px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  width: 48px;
  height: 48px;
  margin: 0 auto;
}

.mini-qr-cell img, .mini-qr-cell canvas {
  width: 40px !important;
  height: 40px !important;
}

/* ======================================================== */
/* MÓDULO 5: ROTA DE INSPEÇÃO GUIADA & COMPROVAÇÃO QR CODE   */
/* ======================================================== */
.route-header-banner {
  background: linear-gradient(135deg, #FFFFFF 0%, #F1F5F9 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.route-title-area h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0.35rem 0 0.2rem;
}

.route-title-area p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0;
}

.route-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EBF7EE;
  color: #16A34A;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 9999px;
  letter-spacing: 0.5px;
  border: 1px solid #BBF7D0;
}

.route-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16A34A;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.route-controls-box {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.route-control-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.route-control-item label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.route-shift-pill {
  display: inline-block;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
}

/* Faixa de KPIs e Progresso da Rota */
.route-kpi-bar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 1rem;
}

.route-kpi-item {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.route-kpi-item.highlight {
  background: #F0F7FF;
  border-color: #BFDBFE;
}

.route-kpi-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.route-kpi-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}

.route-kpi-item.success .route-kpi-val { color: #16A34A; }
.route-kpi-item.warning .route-kpi-val { color: #D97706; }
.route-kpi-item.danger .route-kpi-val { color: #DC2626; }

.route-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.route-progress-bar {
  flex: 1;
  height: 8px;
  background: #E2E8F0;
  border-radius: 9999px;
  overflow: hidden;
}

.route-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary) 0%, #16A34A 100%);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.route-progress-pct {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
  min-width: 38px;
  text-align: right;
}

/* Layout de 2 Colunas */
.inspection-route-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .inspection-route-layout {
    grid-template-columns: 1fr;
  }
  .route-kpi-bar {
    grid-template-columns: 1fr 1fr;
  }
}

/* Card do Scanner */
.scanner-card-sticky {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 1rem;
}

.scanner-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.scanner-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scanner-title-group h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
}

.scanner-status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  background: #F1F5F9;
  color: var(--text-muted);
  border: 1px solid #CBD5E1;
}

.scanner-status-pill.active {
  background: #EBF7EE;
  color: #16A34A;
  border-color: #BBF7D0;
}

.qr-viewport-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #0F172A;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-viewport-area {
  width: 100% !important;
  height: 100% !important;
}

.qr-viewport-overlay-guide {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-guide-frame {
  width: 180px;
  height: 180px;
  position: relative;
}

.qr-guide-frame .corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--secondary);
  border-style: solid;
}

.corner.top-left { top: 0; left: 0; border-width: 3px 0 0 3px; border-top-left-radius: 4px; }
.corner.top-right { top: 0; right: 0; border-width: 3px 3px 0 0; border-top-right-radius: 4px; }
.corner.bottom-left { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-bottom-left-radius: 4px; }
.corner.bottom-right { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-bottom-right-radius: 4px; }

/* Comprovante de Presença Física */
.qr-proof-badge-success {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

.qr-proof-badge-success .proof-icon {
  font-size: 1.4rem;
}

.proof-details {
  display: flex;
  flex-direction: column;
}

.proof-details strong {
  font-size: 0.84rem;
  color: #065F46;
  font-weight: 800;
}

.proof-time {
  font-size: 0.75rem;
  color: #047857;
  font-weight: 600;
}

.btn-block {
  width: 100%;
}

/* Cards das Partes da Rota */
.route-parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.route-part-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.route-part-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.route-part-card.status-done {
  border-left: 4px solid #16A34A;
  background: #FDFEFE;
}

.route-part-card.status-anomaly {
  border-left: 4px solid #DC2626;
  background: #FFFDFD;
}

.route-part-card.status-pending {
  border-left: 4px solid #94A3B8;
}

.part-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0.6rem;
}

.part-card-equip {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
}

.part-card-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0.2rem 0;
  line-height: 1.25;
}

.part-card-family {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: monospace;
}

.part-card-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  white-space: nowrap;
}

.part-card-status-pill.done {
  background: #EBF7EE;
  color: #16A34A;
  border: 1px solid #BBF7D0;
}

.part-card-status-pill.anomaly {
  background: #FEE2E2;
  color: #DC2626;
  border: 1px solid #FECACA;
}

.part-card-status-pill.pending {
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #E2E8F0;
}

.part-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 1rem;
  border-top: 1px solid #F1F5F9;
  padding-top: 0.75rem;
}

.btn-part-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0.45rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.btn-part-action.sim-qr {
  background: #F8FAFC;
  color: var(--primary);
  border-color: #CBD5E1;
}

.btn-part-action.sim-qr:hover {
  background: #E2E8F0;
}

.btn-part-action.inspect {
  background: var(--primary);
  color: #FFFFFF;
}

.btn-part-action.inspect:hover {
  background: var(--primary-dark);
}

/* Modal de Inspeção Guiada (Módulo 5) */
.inspection-proof-summary {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.proof-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.proof-asset-info h4 {
  margin: 0.2rem 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
}

.proof-part-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--secondary);
}

.proof-meta-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
}

.proof-meta-lbl {
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 4px;
}

.proof-meta-box code {
  background: #E2E8F0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.74rem;
  color: #334155;
}

.inspection-instruction-banner {
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
  color: #0369A1;
  margin-bottom: 1.25rem;
}

/* Lista de Itens do Checklist no Modal */
.inspection-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.insp-item-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s;
}

.insp-item-card:hover {
  border-color: #94A3B8;
}

.insp-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.insp-item-desc {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.35;
}

.insp-item-criteria {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Grupo de Botões C / NC / NA */
.btn-check-group {
  display: inline-flex;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.btn-check-choice {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 800;
  border: none;
  background: #FFFFFF;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  border-right: 1px solid #CBD5E1;
}

.btn-check-choice:last-child {
  border-right: none;
}

.btn-check-choice:hover {
  background: #F1F5F9;
}

.btn-check-choice.active-c {
  background: #16A34A;
  color: #FFFFFF;
}

.btn-check-choice.active-nc {
  background: #DC2626;
  color: #FFFFFF;
}

.btn-check-choice.active-na {
  background: #64748B;
  color: #FFFFFF;
}

/* Bloco Expansível de Não Conformidade (NC) */
.insp-nc-panel {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-top: 0.75rem;
  display: none;
}

.insp-nc-panel.open {
  display: block;
}

.nc-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.nc-panel-header strong {
  font-size: 0.84rem;
  color: #991B1B;
}

.btn-emergency-os {
  background: #DC2626;
  color: #FFFFFF;
  font-size: 0.76rem;
  font-weight: 800;
  border: none;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-emergency-os:hover {
  background: #B91C1C;
}
