/* ==========================================================================
   TEF/POS Manager 2.0 (Zona de Controle) - Remodeled Modern Design System
   ========================================================================== */

:root {
  /* Core Light Palette - Modern, Crisp, High Contrast */
  --bg-body: #f1f5f9;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #ffffff;
  --border-color: #cbd5e1;
  --border-focus: #2563eb;
  
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-light: #475569;
  
  /* Brand Accents */
  --purple: #7c3aed;
  --purple-light: rgba(124, 58, 237, 0.12);
  --purple-glow: rgba(124, 58, 237, 0.25);
  
  --blue: #2563eb;
  --blue-light: rgba(37, 99, 235, 0.12);
  --blue-glow: rgba(37, 99, 235, 0.25);
  
  --cyan: #0891b2;
  --cyan-light: rgba(8, 145, 178, 0.12);
  --cyan-glow: rgba(8, 145, 178, 0.25);
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.12);
  --primary-glow: rgba(37, 99, 235, 0.25);
  
  --teal: #0d9488;
  --teal-light: rgba(13, 148, 136, 0.12);
  
  /* Status Colors */
  --status-pending: #b45309;
  --status-pending-bg: #fef3c7;
  --status-success: #047857;
  --status-success-bg: #d1fae5;
  --status-danger: #b91c1c;
  --status-danger-bg: #fee2e2;
  --status-active: #1d4ed8;
  --status-active-bg: #dbeafe;
  
  /* Layout & Shadows */
  --sidebar-width: 240px;
  --sidebar-collapsed: 70px;
  --header-height: 68px;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 10px -1px rgba(0, 0, 0, 0.1), 0 2px 5px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.12), 0 4px 8px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
  
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Dark Mode Theme */
body.dark-mode {
  --bg-body: #090d16;
  --bg-sidebar: #0e1526;
  --bg-card: #121a2d;
  --bg-card-hover: #18233d;
  --bg-input: #151f36;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-focus: #8b5cf6;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  
  --primary: #8b5cf6;
  --primary-hover: #a78bfa;
  --primary-light: rgba(139, 92, 246, 0.18);
  --primary-glow: rgba(139, 92, 246, 0.35);
  
  --status-pending: #f59e0b;
  --status-pending-bg: rgba(245, 158, 11, 0.18);
  --status-success: #10b981;
  --status-success-bg: rgba(16, 185, 129, 0.18);
  --status-danger: #ef4444;
  --status-danger-bg: rgba(239, 68, 68, 0.18);
  --status-active: #3b82f6;
  --status-active-bg: rgba(59, 130, 246, 0.18);
  
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.55);
  --shadow-xl: 0 20px 35px rgba(0, 0, 0, 0.65);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Layout Container */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ==========================================================================
   Sidebar Navigation (Collapsible)
   ========================================================================== */
.sidebar-nav {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 14px;
  z-index: 100;
  transition: width 0.25s ease, min-width 0.25s ease, max-width 0.25s ease;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav.collapsed {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
  max-width: var(--sidebar-collapsed);
  padding: 20px 10px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 24px;
  padding-left: 2px;
}

.sidebar-brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  overflow: hidden;
  text-decoration: none;
  min-width: 0;
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  overflow: hidden;
  white-space: nowrap;
}

.brand-title-main {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.brand-title-sub {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--purple);
  letter-spacing: 0.6px;
}

.sidebar-top-toggle-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.sidebar-top-toggle-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-focus);
}

.sidebar-nav.collapsed .brand-title {
  display: none !important;
}

.sidebar-nav.collapsed .sidebar-header {
  justify-content: center;
  padding-left: 0;
}

.sidebar-nav.collapsed .sidebar-top-toggle-btn {
  display: none !important;
}

.sidebar-logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.4);
  flex-shrink: 0;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-logo-icon:hover {
  transform: scale(1.05);
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  white-space: nowrap;
}

.sidebar-link-text {
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.sidebar-btn svg {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: var(--transition);
}

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

.sidebar-btn:hover svg {
  color: var(--primary);
}

.sidebar-btn.active {
  background: #ede9fe;
  border: 1px solid #c4b5fd;
  color: #6d28d9;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.15);
}

.sidebar-btn.active svg {
  color: #7c3aed;
}

body.dark-mode .sidebar-btn.active {
  background: var(--purple-light);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

body.dark-mode .sidebar-btn.active svg {
  color: #a78bfa;
}

.sidebar-nav.collapsed .sidebar-btn {
  padding: 12px;
  justify-content: center;
}

.sidebar-nav.collapsed .sidebar-btn span {
  display: none;
}

.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}

.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

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

.sidebar-nav.collapsed .sidebar-toggle-btn {
  justify-content: center;
  padding: 10px;
}

.sidebar-nav.collapsed .sidebar-toggle-btn span {
  display: none;
}

/* ==========================================================================
   Main Content Wrapper & Top Navbar
   ========================================================================== */
.main-wrapper {
  margin-left: 240px;
  width: calc(100% - 240px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s ease, width 0.25s ease;
  position: relative;
  z-index: 1;
}

.sidebar-nav.collapsed ~ .main-wrapper,
body:has(.sidebar-nav.collapsed) .main-wrapper {
  margin-left: 70px;
  width: calc(100% - 70px);
}

.top-navbar {
  height: var(--header-height);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.top-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 20px;
}

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

.brand-logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo-text .brand-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--purple);
  background: var(--purple-light);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.top-nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.top-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.top-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.top-tab-btn.active {
  color: #a78bfa;
  font-weight: 600;
}

.top-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: #a78bfa;
  border-radius: 2px;
  box-shadow: 0 0 8px #a78bfa;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  color: var(--text-main);
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
}

.btn-share-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.btn-share-link:hover {
  background: var(--bg-card-hover);
  border-color: var(--purple);
  color: #a78bfa;
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.2);
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue-light);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
}

/* ==========================================================================
   Main Page Content & Tab Views
   ========================================================================== */
.main-content {
  flex: 1;
  padding: 28px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.tab-pane.active {
  display: block;
}

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

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ==========================================================================
   Dashboard 2.0 - 5 KPI Cards with Sparklines
   ========================================================================== */
.kpi-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card-v2 {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 18px 12px 18px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card-v2:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-lg);
}

.kpi-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.kpi-icon-square {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-label-block {
  display: flex;
  flex-direction: column;
}

.kpi-card-v2 .kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.kpi-card-v2 .kpi-number {
  font-family: 'Outfit', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
}

/* Wave Sparkline Container */
.kpi-wave-box {
  width: 100%;
  height: 32px;
  margin-top: 4px;
}

.kpi-wave-box svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Color Variations for KPI Cards */
.kpi-card-purple .kpi-icon-square {
  background: rgba(139, 92, 246, 0.18);
  color: #a78bfa;
}
.kpi-card-purple:hover { border-color: rgba(139, 92, 246, 0.4); }

.kpi-card-blue .kpi-icon-square {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}
.kpi-card-blue:hover { border-color: rgba(59, 130, 246, 0.4); }

.kpi-card-cyan .kpi-icon-square {
  background: rgba(6, 182, 212, 0.18);
  color: #22d3ee;
}
.kpi-card-cyan:hover { border-color: rgba(6, 182, 212, 0.4); }

.kpi-card-amber .kpi-icon-square {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}
.kpi-card-amber:hover { border-color: rgba(245, 158, 11, 0.4); }

.kpi-card-green .kpi-icon-square {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}
.kpi-card-green:hover { border-color: rgba(16, 185, 129, 0.4); }

.kpi-card-whatsapp .kpi-icon-square {
  background: rgba(37, 211, 102, 0.18);
  color: #25d366;
}
.kpi-card-whatsapp:hover {
  border-color: rgba(37, 211, 102, 0.5);
  box-shadow: 0 4px 18px rgba(37, 211, 102, 0.15);
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.25) !important;
}

.btn-whatsapp:hover {
  background: linear-gradient(135deg, #20ba5a 0%, #0e7266 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4) !important;
}

/* ==========================================================================
   Central de Relatórios - Grid & Cards Padronizados de Indicadores
   ========================================================================== */
.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
  align-items: stretch;
}

@media (max-width: 1200px) {
  .report-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
  }
}

.report-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 18px 14px 18px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 156px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.report-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.report-kpi-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.report-kpi-icon-subtle {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.report-kpi-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-kpi-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 14px;
}

.report-kpi-center .kpi-number {
  font-family: 'Outfit', sans-serif;
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.report-kpi-footer {
  margin-top: auto;
  padding-top: 6px;
}

.btn-card-action,
.btn-exportar {
  width: 100%;
  box-sizing: border-box;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  font-size: 0.82rem;
  padding: 6px 8px;
  height: auto;
  min-height: 34px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  outline: none;
  border: 1px solid transparent;
}

.btn-card-action span,
.btn-exportar span {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  display: inline-block;
  max-width: 100%;
}

.btn-card-action svg,
.btn-exportar svg {
  flex-shrink: 0;
}

.btn-card-action:hover,
.btn-exportar:hover {
  transform: translateY(-1px);
}

/* Card 1: TEF (Purple) */
.report-kpi-card.kpi-card-purple .report-kpi-icon-subtle {
  background: rgba(139, 92, 246, 0.16);
  color: #a78bfa;
}
.report-kpi-card.kpi-card-purple:hover {
  border-color: rgba(139, 92, 246, 0.45);
}
.report-kpi-card.kpi-card-purple .btn-card-action {
  border-color: rgba(139, 92, 246, 0.35);
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.08);
}
.report-kpi-card.kpi-card-purple .btn-card-action:hover {
  background: rgba(139, 92, 246, 0.22);
  border-color: #a78bfa;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.25);
}

/* Card 2: SmartPOS (Blue) */
.report-kpi-card.kpi-card-blue .report-kpi-icon-subtle {
  background: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
}
.report-kpi-card.kpi-card-blue:hover {
  border-color: rgba(59, 130, 246, 0.45);
}
.report-kpi-card.kpi-card-blue .btn-card-action {
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.08);
}
.report-kpi-card.kpi-card-blue .btn-card-action:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: #60a5fa;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.25);
}

/* Card 3: Fila de Pendências (Amber) */
.report-kpi-card.kpi-card-amber .report-kpi-icon-subtle {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}
.report-kpi-card.kpi-card-amber:hover {
  border-color: rgba(245, 158, 11, 0.45);
}
.report-kpi-card.kpi-card-amber .btn-card-action {
  border-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.08);
}
.report-kpi-card.kpi-card-amber .btn-card-action:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: #fbbf24;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25);
}

/* Card 4: Documento Geral PDF (Green) */
.report-kpi-card.kpi-card-green .report-kpi-icon-subtle {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
}
.report-kpi-card.kpi-card-green:hover {
  border-color: rgba(16, 185, 129, 0.45);
}
.report-kpi-card.kpi-card-green .btn-card-action {
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.08);
}
.report-kpi-card.kpi-card-green .btn-card-action:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: #34d399;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25);
}

/* Card 5: Compartilhamento WhatsApp */
.report-kpi-card.kpi-card-whatsapp .report-kpi-icon-subtle {
  background: rgba(37, 211, 102, 0.16);
  color: #25d366;
}
.report-kpi-card.kpi-card-whatsapp:hover {
  border-color: rgba(37, 211, 102, 0.5);
}
.report-kpi-card.kpi-card-whatsapp .btn-card-action {
  border-color: rgba(37, 211, 102, 0.35);
  color: #4ade80;
  background: rgba(37, 211, 102, 0.08);
}
.report-kpi-card.kpi-card-whatsapp .btn-card-action:hover {
  background: rgba(37, 211, 102, 0.22);
  border-color: #25d366;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(37, 211, 102, 0.25);
}

/* Card 4: Pendências SmartPOS (Orange / Coral) */
.report-kpi-card.kpi-card-orange .report-kpi-icon-subtle {
  background: rgba(249, 115, 22, 0.16);
  color: #fb923c;
}
.report-kpi-card.kpi-card-orange:hover {
  border-color: rgba(249, 115, 22, 0.45);
}
.report-kpi-card.kpi-card-orange .btn-card-action {
  border-color: rgba(249, 115, 22, 0.35);
  color: #fdba74;
  background: rgba(249, 115, 22, 0.08);
}
.report-kpi-card.kpi-card-orange .btn-card-action:hover {
  background: rgba(249, 115, 22, 0.22);
  border-color: #fb923c;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(249, 115, 22, 0.25);
}

/* Card 5: Total de Maquinetas Instaladas (Emerald / Executive) */
.report-kpi-card.kpi-card-emerald {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.07) 0%, var(--bg-card) 100%);
  border: 1px solid rgba(16, 185, 129, 0.32);
}
.report-kpi-card.kpi-card-emerald .report-kpi-icon-subtle {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}
.report-kpi-card.kpi-card-emerald:hover {
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.18);
}
.report-kpi-card.kpi-card-emerald .kpi-number-emerald {
  color: #10b981;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}
.kpi-tag-consolidado {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  user-select: none;
}
.kpi-tag-dot-emerald {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
  animation: pulse-emerald 2s infinite ease-in-out;
}
@keyframes pulse-emerald {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Botão badge 'Hoje' para campos de data */
.btn-badge-today {
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.btn-badge-today:hover {
  background: rgba(99, 102, 241, 0.3);
  color: #ffffff;
  border-color: #818cf8;
}

/* ==========================================================================
   Dashboard 2.0 - 3 Analytics Cards (Donut Status + UF Distribution)
   ========================================================================== */
.analytics-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  gap: 20px;
  margin-bottom: 24px;
}

.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

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

.card-header-v2 h3 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
}

.info-icon-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* Donut & Legend Flex Layout */
.donut-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.donut-chart-box {
  width: 140px;
  height: 140px;
  position: relative;
  flex-shrink: 0;
}

.donut-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.donut-center-text .num {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
  display: block;
}

.donut-center-text .lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.donut-legend-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.legend-val {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.85rem;
}

.card-footer-link {
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  margin-top: 6px;
  text-align: center;
}

.card-footer-link a {
  color: #a78bfa;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.card-footer-link a:hover {
  color: #c4b5fd;
  text-decoration: underline;
}

/* ==========================================================================
   Dashboard 2.0 - 2 Comparative & Timeline Charts
   ========================================================================== */
.analytics-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .analytics-grid-2 {
    grid-template-columns: 1fr;
  }
}

.chart-canvas-container {
  width: 100%;
  height: 250px;
  position: relative;
}

/* ==========================================================================
   Tables & Data Grid (TEF & SmartPOS)
   ========================================================================== */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  padding: 16px 24px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.table-header-tools {
  padding: 12px 0 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 12px;
}

.table-records-count {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.data-table thead {
  position: sticky;
  top: 0;
  background: var(--bg-card-hover);
  z-index: 10;
}

.data-table th {
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
  cursor: pointer;
}

.data-table tbody tr:hover {
  background-color: var(--bg-card-hover);
}

.sortable-th {
  cursor: pointer;
  user-select: none;
}

.sortable-th:hover {
  color: var(--text-main);
}

.th-content {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sort-icon {
  font-size: 0.8rem;
  color: var(--text-light);
}

.sortable-th.active .sort-icon {
  color: var(--primary);
  font-weight: bold;
}

/* Clean Monospace CNPJ Display */
.cnpj-code-clean {
  font-family: 'SF Mono', Consolas, Monaco, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text-main);
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  cursor: pointer;
  user-select: all;
  transition: all 0.15s ease;
  display: inline-block;
}

.cnpj-code-clean:hover {
  background: var(--bg-card);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Badges, Buttons & Filters
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-pending {
  background: var(--status-pending-bg);
  color: var(--status-pending);
  border: 1px solid rgba(180, 83, 9, 0.25);
}

.badge-success {
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid rgba(4, 120, 87, 0.25);
}

.badge-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid rgba(185, 28, 28, 0.25);
}

.badge-neutral {
  background: var(--bg-card-hover);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

body.dark-mode .badge-pending {
  border-color: rgba(245, 158, 11, 0.35);
}

body.dark-mode .badge-success {
  border-color: rgba(16, 185, 129, 0.35);
}

body.dark-mode .badge-danger {
  border-color: rgba(239, 68, 68, 0.35);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(147, 51, 234, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #7e22ce 100%);
  box-shadow: 0 0 20px rgba(147, 51, 234, 0.5);
  transform: translateY(-1px);
}

.btn-teal {
  background: linear-gradient(135deg, #0d9488 0%, #06b6d4 100%);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.35);
}

.btn-teal:hover {
  background: linear-gradient(135deg, #0f766e 0%, #0891b2 100%);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
  font-weight: 600;
}

.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  color: var(--primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-action-edit {
  color: #6d28d9 !important;
  border-color: #c4b5fd !important;
  background: #ede9fe !important;
  font-weight: 700 !important;
}

.btn-action-edit:hover {
  background: #7c3aed !important;
  color: #ffffff !important;
  border-color: #7c3aed !important;
}

body.dark-mode .btn-action-edit {
  color: #c4b5fd !important;
  border-color: rgba(167, 139, 250, 0.35) !important;
  background: rgba(139, 92, 246, 0.15) !important;
}

body.dark-mode .btn-action-edit:hover {
  background: #8b5cf6 !important;
  color: #ffffff !important;
  border-color: #8b5cf6 !important;
}

/* Filters & Input Bar */
.filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.filter-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
}

.spos-filter-grid {
  grid-template-columns: 1.8fr 1.2fr 1fr 1fr auto;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

input[type="text"],
input[type="search"],
input[type="tel"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 9px 14px 9px 36px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #64748b;
  opacity: 1;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #64748b;
}

select {
  padding-left: 14px;
  color: var(--text-main);
  background-color: var(--bg-input);
}

select option {
  background-color: #ffffff;
  color: #0f172a;
}

body.dark-mode select option {
  background-color: #121a2d;
  color: #f8fafc;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: var(--bg-input);
  color: var(--text-main);
  box-shadow: 0 0 0 3px var(--primary-light);
}

::selection {
  background: #bfdbfe;
  color: #0f172a;
}

body.dark-mode ::selection {
  background: rgba(139, 92, 246, 0.45);
  color: #ffffff;
}

/* ==========================================================================
   Modals & Forms
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

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

.modal-title {
  font-size: 1.18rem;
  font-weight: 700;
}

.modal-body {
  padding: 24px;
}

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

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

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

.form-field-full {
  grid-column: span 2;
}

.form-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.item-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.item-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-cell span {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.item-cell strong {
  font-size: 0.95rem;
  color: var(--text-main);
}

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

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  font-size: 0.88rem;
  font-weight: 500;
  animation: toastSlideIn 0.25s ease;
}

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-success { border-left: 4px solid var(--status-success); }
.toast-error { border-left: 4px solid var(--status-danger); }
.toast-info { border-left: 4px solid var(--primary); }

/* Floating Action Button (FAB) - Oculto no desktop para eliminar poluição visual e conflito com botões do topo */
.fab-btn {
  display: none !important;
}

@media (max-width: 768px) {
  .fab-btn {
    display: flex !important;
    position: fixed;
    bottom: calc(72px + env(safe-area-inset-bottom));
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 20px rgba(147, 51, 234, 0.4);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 45;
    transition: var(--transition);
  }

  .fab-btn:hover {
    transform: scale(1.08) rotate(90deg);
  }
}

/* Responsive Media Queries */
@media (max-width: 1300px) {
  .kpi-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .kpi-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
  .analytics-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1024px) {
  .sidebar-nav {
    width: var(--sidebar-collapsed);
    min-width: var(--sidebar-collapsed);
    max-width: var(--sidebar-collapsed);
  }
  .sidebar-nav .sidebar-btn span,
  .sidebar-nav .sidebar-toggle-btn span {
    display: none;
  }
  .main-wrapper {
    margin-left: 70px;
    width: calc(100% - 70px);
  }
  .analytics-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* Regras da gaveta mobile implementadas na seção mobile */
  .main-wrapper,
  .sidebar-nav.collapsed ~ .main-wrapper,
  body:has(.sidebar-nav.collapsed) .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .kpi-grid-5 {
    grid-template-columns: 1fr 1fr;
  }
  .analytics-grid-3 {
    grid-template-columns: 1fr;
  }
  .filter-grid, .spos-filter-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
 * SmartPOS 2.0 - Rich Dark Aesthetic (Conforme Imagem 2 & 1)
 * ========================================== */

/* Top 4 KPI Summary Grid */
.spos-kpi-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.spos-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.spos-kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-hover);
}

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

.spos-kpi-title {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.spos-kpi-val {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  line-height: 1.1;
  margin: 6px 0 4px 0;
  color: var(--text-main);
}

.spos-kpi-val.text-warning { color: #f59e0b; }
.spos-kpi-val.text-success { color: #10b981; }
.spos-kpi-val.text-muted-val { color: var(--text-muted); }

.spos-kpi-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Participant / Responsible Filter Card */
.spos-participant-filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 20px;
}

.spos-participant-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.spos-participant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.spos-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.spos-chip-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.spos-chip-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 12px var(--primary-glow);
}

body.dark-mode .spos-chip-btn {
  background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .spos-chip-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.spos-chip-btn.dashed {
  border-style: dashed;
}

.spos-chip-badge {
  background: #e2e8f0;
  color: #334155;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
}

body.dark-mode .spos-chip-badge {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.spos-chip-btn.active .spos-chip-badge {
  background: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* Toolbar Card & Status Tabs */
.spos-toolbar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.spos-toolbar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.spos-toolbar-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.spos-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-main);
  margin: 0;
}

.spos-auto-sync-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: #047857;
  background: #d1fae5;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #a7f3d0;
  font-weight: 700;
}

body.dark-mode .spos-auto-sync-hint {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.spos-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulseSync 2s infinite ease-in-out;
}

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

.spos-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

body.dark-mode .spos-status-tabs {
  background: rgba(0, 0, 0, 0.25);
}

.spos-tab-btn {
  padding: 6px 14px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

body.dark-mode .spos-tab-btn {
  color: var(--text-muted);
}

.spos-tab-btn:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.06);
}

body.dark-mode .spos-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.spos-tab-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}

.spos-tab-btn[data-status="PENDENTE"].active {
  background: #d97706;
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.4);
}

.spos-tab-btn[data-status="ATIVO"].active {
  background: #059669;
  box-shadow: 0 2px 10px rgba(5, 150, 105, 0.4);
}

.spos-tab-btn[data-status="INATIVO"].active {
  background: #475569;
  box-shadow: 0 2px 10px rgba(71, 85, 105, 0.4);
}

.spos-tab-btn[data-status="RECUSADO"].active {
  background: #dc2626;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.4);
}

.spos-tab-btn[data-status="CANCELADO"].active {
  background: #991b1b;
  box-shadow: 0 2px 10px rgba(153, 27, 27, 0.4);
}

.spos-tab-btn[data-status="BAIXADO"].active {
  background: #0284c7;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.4);
}

/* Search Row & View Switcher */
.spos-search-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.spos-search-group {
  flex: 1;
  min-width: 260px;
}

/* Componente Unificado de Seleção de Critério de Busca ("Buscar por") */
.unified-search-bar {
  display: flex;
  align-items: stretch;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  overflow: hidden;
  height: 40px;
  flex: 1;
  min-width: 280px;
}

.unified-search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.unified-search-select {
  flex-shrink: 0;
  width: auto;
  min-width: 135px;
  background: rgba(255, 255, 255, 0.04);
  border: none;
  border-right: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0 28px 0 12px;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  appearance: none;
  -webkit-appearance: none;
  transition: background-color 0.15s ease;
}

.unified-search-select:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.unified-search-select option {
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.85rem;
}

.unified-search-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.unified-search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.unified-search-input {
  width: 100%;
  height: 100%;
  padding: 0 36px 0 36px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
}

.unified-search-input::placeholder {
  color: var(--text-dim, #64748b);
  font-size: 0.84rem;
}

.unified-search-clear {
  position: absolute;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.72rem;
  line-height: 1;
  transition: all 0.15s ease;
}

.unified-search-clear:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.rep-filter-search-col {
  grid-column: span 2;
  min-width: 280px;
}

@media (max-width: 900px) {
  .rep-filter-search-col {
    grid-column: span 1;
  }
}

.btn-export-csv {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  color: var(--text-main) !important;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  white-space: nowrap;
}

body.dark-mode .btn-export-csv {
  background: rgba(255, 255, 255, 0.06);
}

.btn-export-csv:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary) !important;
  transform: translateY(-1px);
}

.btn-export-csv:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary) !important;
  transform: translateY(-1px);
}

.spos-view-switch-box {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

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

.spos-view-btn:hover {
  color: var(--text-main);
}

.spos-view-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

/* Request Cards Grid */
.spos-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  align-items: stretch;
}

.spos-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  gap: 14px;
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.spos-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-hover);
}

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

.spos-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  text-transform: uppercase;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.6em;
}

.spos-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.spos-badge-pill .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.spos-badge-pill.status-ativo {
  background: #d1fae5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.spos-badge-pill.status-ativo .badge-dot {
  background: #059669;
}

.spos-badge-pill.status-pendente {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.spos-badge-pill.status-pendente .badge-dot {
  background: #d97706;
}

.spos-badge-pill.status-inativo {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}
.spos-badge-pill.status-inativo .badge-dot {
  background: #64748b;
}

.spos-badge-pill.status-recusado {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.spos-badge-pill.status-recusado .badge-dot {
  background: #dc2626;
}

.spos-badge-pill.status-cancelado {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.spos-badge-pill.status-cancelado .badge-dot {
  background: #991b1b;
}

.spos-badge-pill.status-baixado {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.spos-badge-pill.status-baixado .badge-dot {
  background: #0284c7;
}

body.dark-mode .spos-badge-pill.status-ativo {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
body.dark-mode .spos-badge-pill.status-pendente {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
body.dark-mode .spos-badge-pill.status-inativo {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}
body.dark-mode .spos-badge-pill.status-recusado {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
body.dark-mode .spos-badge-pill.status-cancelado {
  background: rgba(185, 28, 28, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(185, 28, 28, 0.4);
}
body.dark-mode .spos-badge-pill.status-baixado {
  background: rgba(14, 165, 233, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.4);
}

.spos-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spos-card-code {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: monospace;
  font-weight: 600;
}

.spos-card-resp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-main);
  background: var(--bg-card-hover);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  width: fit-content;
  font-weight: 600;
}

.spos-card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-muted);
  gap: 8px;
  flex-wrap: wrap;
}

.btn-card-edit {
  background: #ede9fe !important;
  border: 1px solid #c4b5fd !important;
  color: #6d28d9 !important;
  font-weight: 700 !important;
  font-size: 0.78rem !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
  white-space: nowrap !important;
}

.btn-card-edit:hover {
  background: #7c3aed !important;
  color: #ffffff !important;
  border-color: #7c3aed !important;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.35) !important;
}

body.dark-mode .btn-card-edit {
  background: rgba(139, 92, 246, 0.15) !important;
  border: 1px solid rgba(139, 92, 246, 0.35) !important;
  color: #c4b5fd !important;
}

body.dark-mode .btn-card-edit:hover {
  background: #8b5cf6 !important;
  color: #ffffff !important;
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4) !important;
}

.btn-card-activate {
  background: #d1fae5 !important;
  border: 1px solid #a7f3d0 !important;
  color: #047857 !important;
  font-weight: 700 !important;
  font-size: 0.78rem !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
  white-space: nowrap !important;
}

.btn-card-activate:hover {
  background: #059669 !important;
  color: #ffffff !important;
  border-color: #059669 !important;
  box-shadow: 0 0 10px rgba(5, 150, 105, 0.35) !important;
}

body.dark-mode .btn-card-activate {
  background: rgba(16, 185, 129, 0.18) !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  color: #34d399 !important;
}

body.dark-mode .btn-card-activate:hover {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4) !important;
}

.spos-card-action {
  font-size: 0.82rem;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease;
}

body.dark-mode .spos-card-action {
  color: #60a5fa;
}

.spos-card-action:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

body.dark-mode .spos-card-action:hover {
  color: #93c5fd;
}

.spos-card-action.pending-analyze {
  color: #fbbf24;
}
.spos-card-action.pending-analyze:hover {
  color: #fde68a;
}

/* Modal Details Styling (Conforme Imagem 1) */
.spos-modal-protocol-ref {
  color: #c084fc;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
}

.spos-modal-email-link {
  color: #c084fc;
  text-decoration: none;
  font-weight: 600;
}
.spos-modal-email-link:hover {
  text-decoration: underline;
}

.spos-modal-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
}
.spos-modal-copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.spos-modal-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 8px;
  background: #06b6d4;
  color: #042f2e;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}
.spos-modal-wa-btn:hover {
  background: #22d3ee;
  transform: translateY(-1px);
}

/* Tags de Motivo de Pendência & Reabertura */
.spos-card-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 8px;
  margin-top: 8px;
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spos-reason-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}

.spos-reason-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.spos-reason-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.spos-reason-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.spos-reason-btn:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.spos-reason-btn.active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #0f172a;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

.spos-reopen-banner {
  background: rgba(245, 158, 11, 0.09);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.84rem;
  color: #fde68a;
}

/* Quick Finalize Button for Pending Tickets */
.btn-quick-finalize {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-quick-finalize:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.btn-quick-finalize:active {
  transform: translateY(0);
}

.btn-quick-finalize.btn-sm {
  padding: 3px 8px;
  font-size: 0.72rem;
}

.spos-badge-pill.status-ativo-pendente {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.spos-badge-pill.status-ativo-pendente .badge-dot {
  background: #f59e0b;
}

@media (max-width: 900px) {
  .spos-kpi-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .spos-toolbar-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .spos-status-tabs {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .spos-cards-grid {
    grid-template-columns: 1fr;
  }
  .spos-kpi-summary-grid {
    grid-template-columns: 1fr;
  }
  .spos-search-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ==========================================================================
   Technician Modal & Detailed Tickets Styles (Reports Drilldown)
   ========================================================================== */
.tecnico-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}
.tecnico-stat-chip .chip-label {
  color: var(--text-muted);
  font-weight: 500;
}
.tecnico-stat-chip .chip-value {
  color: var(--text-main);
  font-weight: 700;
}

.tecnico-month-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.tecnico-month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: var(--bg-card-hover);
  border-left: 4px solid var(--purple);
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.tecnico-ticket-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tecnico-ticket-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.tecnico-ticket-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.tecnico-ticket-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.3;
}

.tecnico-ticket-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.tecnico-ticket-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.tecnico-ticket-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tecnico-ticket-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  margin-top: 4px;
  font-size: 0.78rem;
}

/* Reports Filter & Emission Panel */
.rep-filter-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rep-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}

.rep-filter-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rep-filter-title-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: #ede9fe;
  color: #6d28d9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

body.dark-mode .rep-filter-title-icon {
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple);
}

.rep-filter-shortcuts-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

body.dark-mode .rep-filter-shortcuts-bar {
  background: rgba(255, 255, 255, 0.02);
}

.rep-shortcuts-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.rep-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: flex-end;
}

.rep-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rep-filter-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.rep-filter-input, .rep-filter-select {
  height: 38px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-main);
  border: 1.5px solid var(--border-color);
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.rep-filter-input:focus, .rep-filter-select:focus {
  border-color: var(--primary);
  background: var(--bg-input);
  color: var(--text-main);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.rep-filter-shortcuts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.rep-shortcut-btn {
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.rep-shortcut-btn:hover {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--primary);
}

.rep-shortcut-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  font-weight: 700;
}

.rep-filter-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #ede9fe;
  border: 1px solid #ddd6fe;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: #4c1d95;
  font-weight: 600;
  flex-wrap: wrap;
  gap: 8px;
}

body.dark-mode .rep-filter-summary-bar {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--text-main);
}

.rep-filter-summary-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rep-summary-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  font-weight: 700;
  font-size: 0.78rem;
  color: #1e293b;
}

body.dark-mode .rep-summary-tag {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

/* Print Specific Rules - Modelo Executivo Claro, Otimizado para Folha A4 e Economia de Tinta */
@page {
  size: A4 portrait;
  margin: 10mm 10mm 10mm 10mm;
}

@media print {
  *, *::before, *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif !important;
    font-size: 10.5pt !important;
    line-height: 1.4 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .sidebar-nav, .top-navbar, .fab-btn, .btn, .pagination-bar, .modal-backdrop, .rep-filter-panel, .rep-filter-shortcuts-bar, .segmented-control, .toast-container, .no-print {
    display: none !important;
  }

  .app-shell, .main-wrapper, .main-content {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  .tab-pane {
    display: block !important;
  }

  .page-header h1 {
    font-size: 16pt !important;
    color: #0f172a !important;
  }

  .page-header p {
    color: #475569 !important;
    font-size: 9.5pt !important;
  }

  .table-card {
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    break-inside: auto;
    box-shadow: none !important;
    margin-bottom: 20px !important;
    padding: 12px 14px !important;
  }

  .table-header-tools {
    border-bottom: 1px solid #e2e8f0 !important;
    padding-bottom: 8px !important;
    margin-bottom: 10px !important;
  }

  .data-table {
    width: 100% !important;
    border-collapse: collapse !important;
    color: #0f172a !important;
    background: #ffffff !important;
  }

  .data-table th {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border-top: 1px solid #cbd5e1 !important;
    border-bottom: 2px solid #cbd5e1 !important;
    font-weight: 700 !important;
    font-size: 8.5pt !important;
    text-transform: uppercase !important;
    padding: 7px 6px !important;
    letter-spacing: 0.3px !important;
  }

  .data-table td {
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 6px 6px !important;
    font-size: 8.5pt !important;
    color: #1e293b !important;
    vertical-align: middle !important;
  }

  .data-table tbody tr:nth-child(even) {
    background-color: #f8fafc !important;
  }

  .data-table tbody tr {
    break-inside: avoid;
  }

  .spos-badge-pill {
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 7.5pt !important;
    padding: 2px 6px !important;
  }

  .spos-badge-pill.status-ativo {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border-color: #a7f3d0 !important;
  }

  .spos-badge-pill.status-pendente {
    background: #fffbeb !important;
    color: #b45309 !important;
    border-color: #fde68a !important;
  }

  .kpi-card-v2, .chart-card-v2 {
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    break-inside: avoid;
    box-shadow: none !important;
  }
}

/* ==========================================
   Privacy Mode / LGPD Information Security
   ========================================== */
.privacy-active-btn {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
  color: #10b981 !important;
}

body.privacy-mode .privacy-masked {
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ==========================================
   Client Live Autocomplete & Search Preview
   ========================================== */
.autofill-container {
  position: relative;
  z-index: 40;
}

.search-input-spinner {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  animation: spin 1s linear infinite;
  pointer-events: none;
  opacity: 0.85;
}

@keyframes spin {
  from { transform: translateY(-50%) rotate(0deg); }
  to { transform: translateY(-50%) rotate(360deg); }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

.client-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  animation: fadeInDown 0.18s ease-out;
}

.client-autocomplete-dropdown.hidden {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.client-dropdown-header {
  padding: 10px 14px;
  background: rgba(139, 92, 246, 0.08);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

body.dark-mode .client-dropdown-header {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
}

.client-dropdown-close {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: bold;
  transition: var(--transition);
}

.client-dropdown-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.client-dropdown-table-head {
  display: grid;
  grid-template-columns: 85px 1.4fr 1.4fr 150px 110px 90px;
  gap: 10px;
  padding: 8px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid var(--border-color);
  align-items: center;
  letter-spacing: 0.02em;
}

body.dark-mode .client-dropdown-table-head {
  background: rgba(255, 255, 255, 0.03);
}

.client-dropdown-list {
  display: flex;
  flex-direction: column;
}

.client-dropdown-row {
  display: grid;
  grid-template-columns: 85px 1.4fr 1.4fr 150px 110px 90px;
  gap: 10px;
  padding: 10px 14px;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s ease, transform 0.1s ease;
}

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

.client-dropdown-row:hover,
.client-dropdown-row.selected {
  background: rgba(139, 92, 246, 0.12);
}

body.dark-mode .client-dropdown-row:hover,
body.dark-mode .client-dropdown-row.selected {
  background: rgba(139, 92, 246, 0.22);
}

.client-cod-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--purple);
  background: var(--purple-light);
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
  text-align: center;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.client-fantasia-text {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-razao-text {
  color: var(--text-light);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-cnpj-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.client-cidade-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-action-btn {
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}

.client-action-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.03);
}

.client-empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.search-highlight {
  background: rgba(245, 158, 11, 0.3);
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 700;
}

@media (max-width: 860px) {
  .client-dropdown-table-head {
    display: none;
  }

  .client-dropdown-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 14px;
  }

  .client-dropdown-row-top {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
  }

  .client-fantasia-text,
  .client-razao-text {
    white-space: normal;
  }
}

/* ==========================================================================
   MOBILE & RESPONSIVE DESIGN (< 768px)
   Ultra-streamlined, Touch-First, Clean and Clutter-Free
   ========================================================================== */

/* ==========================================================================
   MOBILE DRAWER NAVIGATION & FULL RESPONSIVENESS (SMARTPHONES < 768px)
   ========================================================================== */

/* Base Component: Mobile Menu Trigger Button (Header) */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  background: var(--bg-card, #1e293b);
  color: var(--text-primary, #ffffff);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  margin-right: 10px;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-btn:hover,
.mobile-menu-btn:focus {
  background: var(--bg-hover, #334155);
}

.mobile-menu-btn:active {
  transform: scale(0.95);
}

/* Base Component: Close Button inside Drawer Header */
.mobile-drawer-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  min-width: 40px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary, #ffffff);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-drawer-close-btn:hover,
.mobile-drawer-close-btn:focus {
  background: rgba(255, 255, 255, 0.15);
}

.mobile-drawer-close-btn:active {
  transform: scale(0.95);
}

/* Dark Backdrop Overlay */
.sidebar-mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

body.mobile-sidebar-open .sidebar-mobile-backdrop {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Regras Estritas para Telas Móveis (< 768px) */
@media (max-width: 768px) {
  /* 1. App Shell & Layout Structure */
  .app-shell {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
  }

  /* 2. Menu Lateral Gaveta (Drawer Móvel) */
  .mobile-menu-btn {
    display: inline-flex !important;
  }

  .mobile-drawer-close-btn {
    display: inline-flex !important;
  }

  .sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: -100% !important;
    width: 285px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 9999 !important;
    background: #0b1120 !important;
    background: var(--bg-sidebar, #0b1120) !important;
    border-right: 1px solid var(--border-color, rgba(255, 255, 255, 0.12)) !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    box-shadow: 12px 0 35px rgba(0, 0, 0, 0.8) !important;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom)) 14px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .sidebar-nav.mobile-open,
  body.mobile-sidebar-open .sidebar-nav {
    left: 0 !important;
  }

  .sidebar-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    margin-bottom: 20px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1)) !important;
  }

  .sidebar-brand-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .brand-title {
    display: flex !important;
    flex-direction: column !important;
  }

  .sidebar-top-toggle-btn {
    display: none !important;
  }

  .sidebar-menu {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  .sidebar-menu li {
    width: 100% !important;
    display: block !important;
    margin: 0 !important;
  }

  .sidebar-btn {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    height: 48px !important;
    min-height: 44px !important;
    padding: 10px 14px !important;
    gap: 12px !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: var(--text-secondary, #94a3b8) !important;
    font-size: 0.92rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
    transform: none !important;
  }

  .sidebar-btn svg {
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0 !important;
  }

  .sidebar-link-text {
    display: inline-block !important;
    font-size: 0.92rem !important;
    opacity: 1 !important;
    white-space: nowrap !important;
  }

  .sidebar-btn.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25) 0%, rgba(109, 40, 217, 0.35) 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(139, 92, 246, 0.45) !important;
  }

  /* 3. Área de Conteúdo Principal (sempre 100% no mobile quando gaveta fechada) */
  .main-wrapper,
  .sidebar-nav ~ .main-wrapper,
  .sidebar-nav.collapsed ~ .main-wrapper,
  body:has(.sidebar-nav) .main-wrapper,
  body:has(.sidebar-nav.collapsed) .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .top-navbar {
    width: 100% !important;
    padding: 8px 12px !important;
    height: auto !important;
    min-height: 58px !important;
  }

  .top-nav-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .brand-section {
    display: flex !important;
    align-items: center !important;
    flex: 1 !important;
  }

  .top-nav-app-name {
    font-size: 0.92rem !important;
    white-space: nowrap !important;
  }

  .brand-tag {
    font-size: 0.65rem !important;
  }

  .main-content {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 12px 10px calc(24px + env(safe-area-inset-bottom)) 10px !important;
    overflow-x: hidden !important;
  }

  /* 4. Cards de Métricas e KPIs no Celular */
  .kpi-grid,
  .kpi-grid-4,
  .kpi-grid-5,
  .spos-kpi-summary-grid,
  .report-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
  }

  .kpi-card,
  .kpi-card-v2 {
    padding: 10px !important;
    border-radius: 12px !important;
    min-height: 44px !important;
  }

  .kpi-number {
    font-size: 1.35rem !important;
    font-weight: 800 !important;
  }

  .kpi-label {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
  }

  /* 5. Tabelas Responsivas com Rolagem Horizontal Touch sem Quebrar Largura */
  .table-responsive,
  .tecnico-section,
  .month-section,
  .report-table-container,
  .table-card {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 12px !important;
  }

  table.data-table,
  table.report-table {
    width: 100% !important;
    min-width: 580px !important;
  }

  /* 6. Formulários de Solicitação -> Colapso em 1 Coluna no Mobile */
  .form-grid,
  .form-row,
  .form-group-row,
  #formTef .form-grid,
  #formSmartpos .form-grid,
  #tefCadastroForm .form-grid,
  #sposCadastroForm .form-grid,
  #panelSolicitacaoTef .form-grid {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .form-field,
  .form-group {
    width: 100% !important;
    margin-bottom: 0 !important;
  }

  .form-field label {
    font-size: 0.8rem !important;
    margin-bottom: 4px !important;
  }

  /* 7. Altura mínima de 44px em Botões, Inputs e Controles Móveis */
  .btn,
  button,
  .sidebar-btn,
  .mobile-menu-btn,
  .btn-icon,
  .form-field input,
  .form-field select,
  .form-field textarea,
  .rep-filter-input,
  .rep-filter-select,
  input[type="text"],
  input[type="search"],
  input[type="password"],
  select {
    min-height: 44px !important;
    touch-action: manipulation !important;
  }

  .btn-sm {
    min-height: 40px !important;
  }

  /* Ajustes adicionais de telas móveis */
  .segmented-control {
    width: 100% !important;
    display: flex !important;
  }

  .segmented-control button {
    flex: 1 !important;
    min-height: 44px !important;
  }

  .page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .page-header .d-flex {
    width: 100% !important;
  }

  .page-header .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .fab-btn {
    bottom: calc(20px + env(safe-area-inset-bottom)) !important;
    right: 16px !important;
    width: 48px !important;
    height: 48px !important;
  }

  .modal-box {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    border-radius: 16px !important;
    margin: auto !important;
  }
}

@media (max-width: 480px) {
  .kpi-grid,
  .kpi-grid-4,
  .kpi-grid-5,
  .spos-kpi-summary-grid,
  .report-kpi-grid {
    grid-template-columns: 1fr !important;
  }
}


/* ==========================================================================
   EQUIPMENT BADGES & AUTOCOMPLETE SUGGESTIONS (SMARTPOS & TEF/PINPAD)
   ========================================================================== */

/* Container for equipment badges */
.client-equip-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 5px;
}

/* Base equipment badge */
.equip-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}

/* Badge SmartPOS: Fundo suave azul/ciano com borda sutil, ícone de maquininha e a quantidade de terminais */
.equip-badge-spos {
  background: rgba(6, 182, 212, 0.12);
  color: #0891b2;
  border: 1px solid rgba(6, 182, 212, 0.35);
  box-shadow: 0 1px 3px rgba(6, 182, 212, 0.08);
}

body.dark-mode .equip-badge-spos {
  background: rgba(6, 182, 212, 0.18);
  color: #22d3ee;
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

/* Badge PINpad / TEF: Fundo suave roxo/índigo com borda sutil, ícone de PINpad/monitor e a quantidade de máquinas */
.equip-badge-tef {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.35);
  box-shadow: 0 1px 3px rgba(139, 92, 246, 0.08);
}

body.dark-mode .equip-badge-tef {
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

/* Badge Neutro / Sem equipamento */
.equip-badge-none {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted, #64748b);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-weight: 600;
  opacity: 0.85;
}

body.dark-mode .equip-badge-none {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.1);
}

/* Dropdown de sugestões do Relatório (Central de Relatórios) */
#repSearchSuggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: max(100%, 540px);
  max-width: min(92vw, 680px);
  z-index: 1050;
  border-radius: var(--radius-md, 10px);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.rep-suggestion-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.rep-suggestion-row:hover,
.rep-suggestion-row.selected {
  background: rgba(139, 92, 246, 0.1);
}

body.dark-mode .rep-suggestion-row:hover,
body.dark-mode .rep-suggestion-row.selected {
  background: rgba(139, 92, 246, 0.2);
}

.rep-sugg-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.rep-sugg-name-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.rep-sugg-fantasia {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rep-sugg-razao {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rep-sugg-badges-col {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.rep-sugg-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.74rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.rep-sugg-code {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--purple);
  background: var(--purple-light);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.rep-sugg-cnpj {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
}

.rep-sugg-cidade {
  color: var(--text-muted);
}

.rep-sugg-action {
  margin-left: auto;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--primary);
  opacity: 0.85;
}

.rep-suggestion-row:hover .rep-sugg-action {
  opacity: 1;
  text-decoration: underline;
}

/* ==========================================
   Real-Time Sync Indicator & Progress Bar
   ========================================== */
.sync-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100000;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.sync-progress-container.fade-out {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.sync-progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(30, 41, 59, 0.2);
  position: relative;
  overflow: hidden;
}

.sync-progress-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent 0%, #38bdf8 30%, #818cf8 70%, transparent 100%);
  box-shadow: 0 0 12px #38bdf8;
  animation: sync-progress-indeterminate 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes sync-progress-indeterminate {
  0% {
    left: -40%;
    width: 30%;
  }
  50% {
    width: 60%;
  }
  100% {
    left: 100%;
    width: 30%;
  }
}

.sync-notification-badge {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 0 18px rgba(56, 189, 248, 0.18);
  border-radius: 9999px;
  padding: 6px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 90vw;
}

.sync-notification-badge.is-slow {
  border-radius: 16px;
  padding: 10px 18px;
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 158, 11, 0.2);
}

.sync-notification-badge.is-success {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 0 20px rgba(16, 185, 129, 0.25);
}

.sync-badge-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sync-spinner {
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sync-spinner .spin-animation {
  animation: sync-spin 0.9s linear infinite;
}

@keyframes sync-spin {
  100% {
    transform: rotate(360deg);
  }
}

.sync-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.sync-main-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f8fafc;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.sync-sub-text {
  font-size: 0.72rem;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
}

.sync-slow-warning {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  animation: sync-fade-in 0.3s ease-out;
}

.sync-slow-warning.hidden {
  display: none !important;
}

.sync-slow-msg {
  font-size: 0.76rem;
  color: #fbbf24;
  font-weight: 500;
  text-align: center;
}

.sync-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sync-action {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-sync-cache {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.btn-sync-cache:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
}

.btn-sync-retry {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.btn-sync-retry:hover {
  background: rgba(245, 158, 11, 0.25);
  color: #fde68a;
}

@keyframes sync-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}





