Compare commits

..

No commits in common. "89892d1522dffe54d9f2e404ec2934bc95f2281a" and "d470f645c2a7151524fc1f8a67d1f6c59f9ca3c1" have entirely different histories.

36 changed files with 637 additions and 4229 deletions

12
package-lock.json generated
View File

@ -16,7 +16,6 @@
"@angular/platform-server": "^20.3.0",
"@angular/router": "^20.3.0",
"@angular/ssr": "^20.3.10",
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.8",
"bootstrap-icons": "^1.13.1",
"express": "^5.1.0",
@ -28,7 +27,6 @@
"@angular/build": "^20.3.10",
"@angular/cli": "^20.3.10",
"@angular/compiler-cli": "^20.3.0",
"@types/bootstrap": "^5.2.10",
"@types/express": "^5.0.1",
"@types/jasmine": "~5.1.0",
"@types/node": "^20.17.19",
@ -3589,16 +3587,6 @@
"@types/node": "*"
}
},
"node_modules/@types/bootstrap": {
"version": "5.2.10",
"resolved": "https://registry.npmjs.org/@types/bootstrap/-/bootstrap-5.2.10.tgz",
"integrity": "sha512-F2X+cd6551tep0MvVZ6nM8v7XgGN/twpdNDjqS1TUM7YFNEtQYWk+dKAnH+T1gr6QgCoGMPl487xw/9hXooa2g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@popperjs/core": "^2.9.2"
}
},
"node_modules/@types/connect": {
"version": "3.4.38",
"resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz",

View File

@ -31,7 +31,6 @@
"@angular/platform-server": "^20.3.0",
"@angular/router": "^20.3.0",
"@angular/ssr": "^20.3.10",
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.8",
"bootstrap-icons": "^1.13.1",
"express": "^5.1.0",
@ -43,7 +42,6 @@
"@angular/build": "^20.3.10",
"@angular/cli": "^20.3.10",
"@angular/compiler-cli": "^20.3.0",
"@types/bootstrap": "^5.2.10",
"@types/express": "^5.0.1",
"@types/jasmine": "~5.1.0",
"@types/node": "^20.17.19",

BIN
public/logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

View File

@ -1,26 +1,13 @@
import {
ApplicationConfig,
provideBrowserGlobalErrorListeners,
provideZoneChangeDetection
} from '@angular/core';
import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChangeDetection } from '@angular/core';
import { provideRouter } from '@angular/router';
import { provideClientHydration, withEventReplay } from '@angular/platform-browser';
import { provideHttpClient, withFetch, withInterceptors } from '@angular/common/http';
import { routes } from './app.routes';
import { authInterceptor } from './interceptors/auth.interceptor';
import { provideClientHydration, withEventReplay } from '@angular/platform-browser';
export const appConfig: ApplicationConfig = {
providers: [
provideBrowserGlobalErrorListeners(),
provideZoneChangeDetection({ eventCoalescing: true }),
provideRouter(routes),
provideClientHydration(withEventReplay()),
// ✅ HttpClient com fetch + interceptor
provideHttpClient(
withFetch(),
withInterceptors([authInterceptor])
),
provideRouter(routes), provideClientHydration(withEventReplay())
]
};

View File

@ -1,13 +1,6 @@
import { Routes } from '@angular/router';
import { Home } from './pages/home/home';
import { Register } from './pages/register/register';
import { LoginComponent } from './pages/login/login';
import { Geral } from './pages/geral/geral';
import { authGuard } from './guards/auth.guard';
export const routes: Routes = [
{ path: '', component: Home },
{ path: "register", component: Register },
{ path: "login", component: LoginComponent },
{ path: 'geral', component: Geral, canActivate: [authGuard] },
];

View File

@ -1,11 +1,10 @@
<button
type="button"
(click)="onClick()"
[style.width]="width"
[style.height]="height"
[style.width.px]="width"
[style.height.px]="height"
[style.background]="background"
[style.color]="color"
[style.font-size]="fontSize"
[style.font-size.px]="fontSize"
[style.font-weight]="fontWeight"
class="cta-button"
>

View File

@ -13,7 +13,7 @@ export class CtaButtonComponent {
@Input() height: string = '55px';
@Input() background: string = '#C91EB5';
@Input() color: string = '#FFFFFF';
@Input() fontSize: string = '16.5px';
@Input() fontSize: string = '18px';
@Input() fontWeight: string = '700';
@Output() clicked = new EventEmitter<void>();

View File

@ -1,31 +1,21 @@
<div class="feature-card-container">
<div
class="feature-card"
(mouseenter)="isHovered = true"
(mouseleave)="isHovered = false"
[ngClass]="{ 'hover-state': isHovered }"
[ngStyle]="{ 'text-align': textAlign }"
>
<!-- brilho sutil -->
<span class="shine" aria-hidden="true"></span>
<!-- Use [ngStyle] para aplicar o alinhamento a todo o bloco do card -->
<div class="feature-card"
(mouseenter)="isHovered = true"
(mouseleave)="isHovered = false"
[ngClass]="{'hover-state': isHovered}"
[ngStyle]="{'text-align': textAlign}"> <!-- 🎯 APLICA O ALINHAMENTO AQUI -->
<!-- Ícone e Título Principal (em rosa) -->
<h3 class="card-title">
<i class="card-icon {{ iconClass }}"></i>
{{ title }}
</h3>
<!-- header -->
<div class="card-head">
<div class="icon-wrap" aria-hidden="true">
<i class="card-icon {{ iconClass }}"></i>
</div>
<h3 class="card-title">
{{ title }}
</h3>
</div>
<!-- descrição -->
<!-- Conteúdo/Descrição do Card -->
<p class="card-description">
<span [innerHTML]="description"></span>
</p>
<!-- linha decorativa -->
<div class="card-accent" aria-hidden="true"></div>
</div>
</div>
</div>

View File

@ -1,250 +1,136 @@
:host {
--brand: #E33DCF;
--text: #111214;
--muted: rgba(17, 18, 20, 0.70);
--radius-xl: 22px;
--radius-lg: 16px;
display: block;
.feature-card-container {
padding: 10px;
}
/* ✅ CARD PRINCIPAL */
/* CARD BASE — mantém o design exato do Figma em desktops */
.feature-card {
position: relative;
overflow: hidden;
width: 365px;
min-height: 175px;
padding: 18px 18px 16px 18px;
border-radius: 18px;
border: 1px solid #000000;
background-color: #FFFFFF;
padding: 30px;
border-radius: 5px;
cursor: default;
background: rgba(255, 255, 255, 0.82);
border: 1px solid rgba(227, 61, 207, 0.18);
backdrop-filter: blur(10px);
box-shadow: 0 18px 38px rgba(17, 18, 20, 0.10);
/* DESKTOP (layout original) */
width: 365px;
height: 169px;
overflow: hidden;
display: flex;
flex-direction: column;
gap: 10px;
justify-content: flex-start;
transform: translateZ(0);
transition:
transform 180ms ease,
border-color 180ms ease,
box-shadow 180ms ease,
background 180ms ease;
/* borda interna sutil */
&::before {
content: '';
position: absolute;
inset: 1px;
border-radius: 17px;
pointer-events: none;
border: 1px solid rgba(255, 255, 255, 0.65);
opacity: 0.75;
}
/* efeito “radial” suave no fundo */
&::after {
content: '';
position: absolute;
inset: -80px;
pointer-events: none;
background:
radial-gradient(380px 200px at 20% 10%, rgba(227, 61, 207, 0.16), transparent 60%),
radial-gradient(320px 180px at 85% 70%, rgba(227, 61, 207, 0.10), transparent 60%);
opacity: 0.85;
}
transition: background-color 0.2s ease-in-out;
/* ================================
📱 RESPONSIVIDADE
================================ */
@media (min-width: 1200px) and (max-width: 1399.98px) {
width: 330px;
min-height: 170px;
height: auto;
padding: 24px;
}
@media (max-width: 1024px) {
width: 330px;
min-height: 170px;
}
@media (max-width: 768px) {
width: 300px;
min-height: 170px;
}
@media (max-width: 480px) {
width: 95%;
min-height: 170px;
}
/* Telas MUITO pequenas (≤ 360px) */
@media (max-width: 360px) {
width: 95%;
min-height: 165px;
padding: 16px;
height: auto;
padding: 20px;
}
/* Celulares (≤ 480px) */
@media (max-width: 480px) {
width: 95%;
height: auto; /* Permite texto quebrar */
}
/* Tablets pequenos (≤ 768px) */
@media (max-width: 768px) {
width: 300px;
height: auto;
}
/* Tablets grandes e monitores pequenos (≤ 1024px) */
@media (max-width: 1024px) {
width: 330px;
height: auto;
}
}
/* ✅ HOVER PREMIUM (sem “cinza chapado”) */
/* HOVER */
.feature-card.hover-state {
transform: translateY(-4px);
border-color: rgba(227, 61, 207, 0.32);
box-shadow: 0 26px 52px rgba(17, 18, 20, 0.14);
background: rgba(255, 255, 255, 0.90);
background-color: #E1E1E1;
}
/* brilho animado (fica bem SaaS) */
.shine {
position: absolute;
inset: -40%;
pointer-events: none;
transform: translateX(-120%) rotate(12deg);
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
opacity: 0.0;
transition: opacity 200ms ease;
z-index: 1;
}
/* -------------------------
TÍTULO DO CARD
-------------------------- */
.card-title {
font-family: 'Inter', sans-serif;
font-size: 20px;
font-weight: 700;
color: #E33DCF;
.feature-card.hover-state .shine {
opacity: 1;
animation: shine 1.25s ease-in-out 1;
}
/* header */
.card-head {
position: relative;
z-index: 2;
margin-top: -15px;
margin-bottom: 10px;
display: flex;
align-items: center;
gap: 12px;
justify-content: center; /* seu layout atual é centralizado */
}
justify-content: center;
/* ícone no estilo do mock */
.icon-wrap {
width: 42px;
height: 42px;
border-radius: 14px;
@media (min-width: 1200px) and (max-width: 1399.98px) {
font-size: 18px;
margin-top: -10px;
}
display: grid;
place-items: center;
background: rgba(227, 61, 207, 0.10);
border: 1px solid rgba(227, 61, 207, 0.22);
transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.feature-card.hover-state .icon-wrap {
transform: translateY(-1px) scale(1.03);
box-shadow: 0 12px 24px rgba(227, 61, 207, 0.18);
background: rgba(227, 61, 207, 0.14);
}
/* ícone */
.card-icon {
font-size: 18px;
color: var(--brand);
}
/* título */
.card-title {
position: relative;
z-index: 2;
margin: 0;
font-family: 'Inter', sans-serif;
font-size: 18px;
font-weight: 950;
color: var(--text);
letter-spacing: -0.2px;
transition: transform 180ms ease, color 180ms ease;
}
.feature-card.hover-state .card-title {
transform: translateY(-1px);
}
/* descrição */
.card-description {
position: relative;
z-index: 2;
margin: 0;
padding: 0 6px;
font-family: 'Inter', sans-serif;
font-size: 14px;
line-height: 1.35;
color: var(--muted);
/* deixa mais “SaaS” e menos apertado */
/* Mobile */
@media (max-width: 480px) {
font-size: 13.5px;
padding: 0 2px;
font-size: 18px;
margin-top: -5px;
}
}
/* ÍCONE */
.card-icon {
margin-right: 10px;
font-size: 24px;
@media (min-width: 1200px) and (max-width: 1399.98px) {
font-size: 22px;
}
/* Mobile */
@media (max-width: 480px) {
font-size: 20px;
}
}
/* -------------------------
DESCRIÇÃO DO CARD
-------------------------- */
.card-description {
font-family: 'Inter', sans-serif;
font-size: 17px;
color: #000000;
line-height: 1;
padding-left: 15px;
@media (min-width: 1200px) and (max-width: 1399.98px) {
font-size: 16px;
line-height: 1.2;
}
/* Mobile */
@media (max-width: 480px) {
font-size: 15px;
padding-left: 8px;
}
}
.card-description strong {
font-weight: 900;
color: #111214;
}
/* linha decorativa inferior */
.card-accent {
position: relative;
z-index: 2;
margin-top: auto;
height: 6px;
border-radius: 999px;
background: rgba(227, 61, 207, 0.12);
border: 1px solid rgba(227, 61, 207, 0.18);
overflow: hidden;
&::after {
content: '';
position: absolute;
inset: 0;
transform: translateX(-60%);
background: linear-gradient(90deg, transparent, rgba(227, 61, 207, 0.28), transparent);
opacity: 0.0;
transition: opacity 180ms ease;
}
}
.feature-card.hover-state .card-accent::after {
opacity: 1;
animation: sweep 1.2s ease-in-out 1;
}
/* acessibilidade: reduz animações */
@media (prefers-reduced-motion: reduce) {
.feature-card,
.icon-wrap,
.card-title {
transition: none !important;
}
.feature-card.hover-state {
transform: none;
}
.feature-card.hover-state .shine,
.feature-card.hover-state .card-accent::after {
animation: none !important;
}
}
/* animações */
@keyframes shine {
0% { transform: translateX(-120%) rotate(12deg); }
100% { transform: translateX(120%) rotate(12deg); }
}
@keyframes sweep {
0% { transform: translateX(-60%); }
100% { transform: translateX(60%); }
font-weight: 700;
}

View File

@ -1,23 +1,24 @@
import { Component, Input, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CommonModule } from '@angular/common'; // <-- Importe aqui!
@Component({
selector: 'app-feature-card',
standalone: true,
imports: [CommonModule],
standalone: true, // <-- DEVE ser standalone
imports: [CommonModule], // <-- PRECISA do CommonModule para usar [ngClass]
templateUrl: './feature-card.html',
styleUrls: ['./feature-card.scss']
})
export class FeatureCardComponent implements OnInit {
// ... o restante da lógica ...
@Input() title: string = '';
@Input() description: string = '';
@Input() iconClass: string = '';
@Input() iconClass: string = '';
@Input() textAlign: 'left' | 'center' = 'left';
isHovered: boolean = false;
isHovered: boolean = false;
constructor() {}
constructor() { }
ngOnInit(): void {}
}
ngOnInit(): void { }
}

View File

@ -1,80 +1,122 @@
/* ===================================== */
/* FOOTER CONTAINER VERSÃO MODERNA */
/* FOOTER CONTAINER */
/* ===================================== */
.footer-container {
width: 100%;
/* Degradê com as cores da marca */
background: linear-gradient(90deg, #030FAA 0%, #6066FF 45%, #C91EB5 100%);
padding: 10px 32px; /* bem mais baixo que antes */
box-sizing: border-box;
margin-top: -0.5px;
background: rgba(3, 15, 170, 0.93);
padding: 10px 60px; /* ⬅️ TOPO/FUNDO DO FOOTER (antes 16px 60px) */
display: flex;
justify-content: space-between;
align-items: center;
gap: 24px;
align-items: flex-start;
font-family: "Inter", sans-serif;
color: #FFFFFF;
border-top: 1px solid rgba(255, 255, 255, 0.12);
/* 💻 NOTEBOOKS 12001399px */
@media (min-width: 1200px) and (max-width: 1399.98px) {
padding: 6px 50px; /* ⬅️ TOPO/FUNDO NO NOTEBOOK (antes 8px 50px) */
}
/* Suave sombra pra destacar do conteúdo */
box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
/* Telas médias e abaixo empilha conteúdo */
/* Telas < 1200px — empilha esquerda e direita */
@media (max-width: 1199.98px) {
flex-direction: column;
justify-content: center;
align-items: center;
padding: 14px 30px; /* ⬅️ TOPO/FUNDO EM TELAS MÉDIAS (antes 18px 30px) */
text-align: center;
padding: 12px 20px;
}
/* Tablets e celulares */
@media (max-width: 768px) {
padding: 12px 16px;
padding: 14px 20px; /* ⬅️ TOPO/FUNDO EM MOBILE (antes 18px 20px) */
align-items: flex-start;
text-align: left;
}
}
/* ===================================== */
/* LADO ESQUERDO (TEXTOS) */
/* LADO ESQUERDO */
/* ===================================== */
.footer-left {
margin: 0; /* remove aqueles 100px enormes de antes */
}
margin-top: 100px; /* ⬅️ DISTÂNCIA DO TEXTO PRO TOPO NO DESKTOP (antes 100px) */
.footer-left p {
margin: 0 0 2px 0; /* menos espaçamento vertical */
font-size: 13px;
font-weight: 500;
/* 💻 NOTEBOOKS 12001399px */
@media (min-width: 1200px) and (max-width: 1399.98px) {
margin-top: 80px; /* ⬅️ DISTÂNCIA NO NOTEBOOK (antes 100px) */
}
/* Telas < 1200px */
@media (max-width: 1199.98px) {
margin-top: 24px;
}
@media (max-width: 768px) {
font-size: 12px;
margin-top: 20px;
}
@media (max-width: 480px) {
font-size: 11.5px;
margin-top: 16px;
}
}
.footer-left p {
/* 🔁 PADRÃO PARA DESKTOPS E NOTEBOOKS: MESMO ESPAÇAMENTO HORIZONTAL */
margin: 0 0 4px 120px;
font-size: 14px;
font-weight: 600;
/* Telas < 1200px */
@media (max-width: 1199.98px) {
margin: 0 0 8px 0;
}
@media (max-width: 768px) {
margin-left: 0;
font-size: 13px;
}
@media (max-width: 480px) {
font-size: 12px;
}
}
/* ===================================== */
/* LADO DIREITO (REDES + BOTÃO) */
/* LADO DIREITO */
/* ===================================== */
.footer-right {
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 8px;
align-items: center;
margin-top: 100px; /* ⬅️ DISTÂNCIA DO BLOCO DIREITO PRO TOPO (antes 100px) */
gap: 0px;
margin-right: 120px; /* espaçamento horizontal já ajustado */
/* 💻 NOTEBOOKS 12001399px */
@media (min-width: 1200px) and (max-width: 1399.98px) {
margin-top: 80px; /* ⬅️ MESMO IDEA DO ESQUERDO (antes 100px) */
gap: 10px;
}
/* Telas < 1200px */
@media (max-width: 1199.98px) {
margin-top: 20px;
margin-right: 0;
align-items: center;
gap: 10px;
}
@media (max-width: 768px) {
align-items: flex-start;
margin-top: 18px;
}
@media (max-width: 480px) {
margin-top: 16px;
}
}
@ -83,14 +125,21 @@
.social-wrapper {
width: 100%;
display: flex;
justify-content: flex-end;
justify-content: flex-start;
margin-bottom: 0;
@media (min-width: 1200px) and (max-width: 1399.98px) {
margin-top: 4px;
}
@media (max-width: 1199.98px) {
justify-content: center;
margin-top: 4px;
}
@media (max-width: 768px) {
justify-content: flex-start;
margin-top: 5px;
}
}
@ -98,6 +147,7 @@
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 0;
@media (max-width: 480px) {
gap: 6px;
@ -105,41 +155,42 @@
}
.social-label {
font-size: 13px;
font-size: 14px;
font-weight: 500;
@media (max-width: 480px) {
font-size: 12px;
font-size: 13px;
}
}
.social-icon i {
font-size: 20px;
font-size: 22px;
color: #FFF;
cursor: pointer;
transition: transform 0.15s ease, opacity 0.15s ease;
transition: 0.2s;
@media (max-width: 480px) {
font-size: 18px;
font-size: 19px;
}
}
.social-icon i:hover {
opacity: 0.8;
transform: translateY(-1px);
opacity: 0.7;
}
/* Botão Política de Privacidade */
/* Botão */
.footer-button-wrapper {
display: flex;
justify-content: flex-end;
margin-top: 0;
@media (min-width: 1200px) and (max-width: 1399.98px) {
margin-top: 6px;
}
@media (max-width: 1199.98px) {
justify-content: center;
margin-top: 6px;
}
@media (max-width: 768px) {
justify-content: flex-start;
margin-top: 10px;
}
}

View File

@ -1,123 +1,35 @@
<header
class="header-container"
[class.header-scrolled]="isScrolled"
>
<header class="header-container">
<div class="header-top">
<!-- ESQUERDA: HAMBURGUER (só no /geral) + LOGO -->
<div class="left-area">
<button
*ngIf="isLoggedHeader"
type="button"
class="hamburger-btn"
aria-label="Abrir menu"
(click)="toggleMenu()"
>
<i class="bi bi-list"></i>
</button>
<!-- ✅ Logo SEMPRE aparece no header -->
<a class="logo-area" routerLink="/">
<img src="logo.png" alt="Logo" class="logo" />
<div class="logo-text ms-2">
<span class="line">Line</span><span class="gestao">Gestão</span>
</div>
</a>
</div>
<!-- LOGO + TÍTULO (CLICÁVEIS) -->
<a class="logo-area" routerLink="/"> <!-- ⬅️ AGORA É UM LINK ANGULAR -->
<img src="logo.jpg" alt="Logo" class="logo">
<!-- ✅ MENU HOME: só aparece fora do /geral -->
<nav class="menu" *ngIf="!isLoggedHeader">
<div class="logo-text ms-2">
<span class="line">Line</span><span class="gestao">Gestão</span>
</div>
</a>
<!-- MENU -->
<nav class="menu">
<a href="https://www.linemovel.com.br/sobrenos" class="menu-item" target="_blank">O que é a Line Móvel?</a>
<a href="https://www.linemovel.com.br/empresas" class="menu-item" target="_blank">Para sua empresa</a>
<a href="https://www.linemovel.com.br/proposta" class="menu-item" target="_blank">Solicite sua Proposta</a>
<a href="https://www.linemovel.com.br/indique" class="menu-item" target="_blank">Indique um amigo</a>
</nav>
<!-- ✅ BOTÕES: só aparecem fora do /geral -->
<div class="btn-area" *ngIf="!isLoggedHeader">
<button type="button" class="btn btn-cadastrar" [routerLink]="['/register']">
Cadastre-se
</button>
<button type="button" class="btn btn-login" [routerLink]="['/login']">
Login
</button>
<!-- BOTÕES -->
<div class="btn-area">
<button class="btn btn-cadastrar">Cadastre-se</button>
<button class="btn btn-login">Login</button>
</div>
</div>
<!-- ✅ FAIXA (SÓ NA HOME) com degradê igual footer -->
<div class="header-bar footer-gradient" *ngIf="isHome">
<span class="header-bar-text">
Somos a escolha certa para estar sempre conectado!
</span>
<!-- FAIXA AZUL -->
<div class="header-bar">
<span class="header-bar-text">Somos a escolha certa para estar sempre conectado!</span>
</div>
</header>
<!-- ✅ OVERLAY (só no /geral) -->
<div
class="menu-overlay"
*ngIf="isLoggedHeader && menuOpen"
(click)="closeMenu()"
></div>
<!-- ✅ MENU LATERAL (só no /geral) -->
<aside
*ngIf="isLoggedHeader"
class="side-menu"
[class.open]="menuOpen"
(click)="$event.stopPropagation()"
>
<div class="side-menu-header">
<!-- ✅ Logo DENTRO do menu lateral -->
<a class="logo-area" routerLink="/" (click)="closeMenu()">
<img src="logo.png" alt="Logo" class="logo" />
<div class="logo-text ms-2">
<span class="line">Line</span><span class="gestao">Gestão</span>
</div>
</a>
<button
type="button"
class="close-btn"
aria-label="Fechar menu"
(click)="closeMenu()"
>
<i class="bi bi-x-lg"></i>
</button>
</div>
<div class="side-menu-body">
<a routerLink="/geral" class="side-item" (click)="closeMenu()">
<i class="bi bi-clipboard-data me-2"></i> Controle de Contratos
</a>
<a routerLink="/geral" class="side-item" (click)="closeMenu()">
<i class="bi bi-sim me-2"></i> Gerenciar Linhas
</a>
<a routerLink="/geral" class="side-item" (click)="closeMenu()">
<i class="bi bi-people me-2"></i> Gerenciar Clientes
</a>
<a routerLink="/geral" class="side-item" (click)="closeMenu()">
<i class="bi bi-bar-chart me-2"></i> Relatórios
</a>
<hr class="my-2" />
<a href="https://www.linemovel.com.br/sobrenos" target="_blank" class="side-item" (click)="closeMenu()">
<i class="bi bi-info-circle me-2"></i> O que é a Line Móvel?
</a>
<a href="https://www.linemovel.com.br/empresas" target="_blank" class="side-item" (click)="closeMenu()">
<i class="bi bi-building me-2"></i> Para sua empresa
</a>
<a href="https://www.linemovel.com.br/proposta" target="_blank" class="side-item" (click)="closeMenu()">
<i class="bi bi-file-earmark-text me-2"></i> Solicite sua Proposta
</a>
<a href="https://www.linemovel.com.br/indique" target="_blank" class="side-item" (click)="closeMenu()">
<i class="bi bi-megaphone me-2"></i> Indique um amigo
</a>
</div>
</aside>

View File

@ -1,46 +1,16 @@
:host {
--brand: #E33DCF;
--blue: #030FAA;
--border: rgba(0, 0, 0, 0.10);
/* ✅ glass */
--glass: rgba(255, 255, 255, 0.35);
--glass-strong: rgba(255, 255, 255, 0.48);
--shadow-soft: 0 10px 26px rgba(0, 0, 0, 0.10);
}
/* ===================== */
/* HEADER PRINCIPAL */
/* ===================== */
.header-container {
width: 100%;
background: #ffffff;
font-family: 'Inter', sans-serif;
display: flex;
flex-direction: column;
position: sticky;
top: 0;
z-index: 1200;
/* ✅ transparente/fosco */
background: var(--glass);
backdrop-filter: blur(18px);
-webkit-backdrop-filter: blur(18px);
border-bottom: 1px solid rgba(227, 61, 207, 0.12);
transition: background 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.header-container.header-scrolled {
background: var(--glass-strong);
box-shadow: var(--shadow-soft);
border-color: rgba(227, 61, 207, 0.18);
}
/* ===================== */
/* TOP AREA */
/* TOP AREA (LOGO + MENU + BOTÕES) */
/* ===================== */
.header-top {
width: 100%;
@ -49,100 +19,47 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: 22px;
justify-content: space-between; /* Alinha logo / menu / botões */
gap: 40px;
@media (max-width: 1200px) {
padding: 0 22px;
gap: 16px;
@media (max-width: 900px) {
gap: 20px;
}
@media (max-width: 1024px) {
padding: 0 18px;
gap: 14px;
@media (max-width: 768px) {
padding: 0 20px;
}
@media (max-width: 600px) {
flex-direction: column;
height: auto;
padding: 12px 14px;
gap: 12px;
padding: 12px 0;
}
}
/* ✅ Centralizar menu em telas grandes (desktop) */
@media (min-width: 993px) {
.header-top {
display: grid;
grid-template-columns: auto 1fr auto; /* esquerda | centro | direita */
align-items: center;
/* como agora é grid, não usamos space-between */
justify-content: unset;
}
.menu {
width: 100%;
justify-content: center; /* ✅ centraliza os links no centro */
}
}
.left-area {
display: flex;
align-items: center;
gap: 12px;
flex: 0 0 auto;
}
/* ===================== */
/* HAMBURGUER (GERAL) */
/* ===================== */
.hamburger-btn {
width: 44px;
height: 44px;
border-radius: 12px;
border: 1px solid rgba(0, 0, 0, 0.10);
background: rgba(255, 255, 255, 0.55);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
display: grid;
place-items: center;
cursor: pointer;
transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.hamburger-btn i {
color: var(--brand);
font-size: 22px;
}
.hamburger-btn:hover {
transform: translateY(-1px);
box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
border-color: rgba(227, 61, 207, 0.22);
}
.hamburger-btn:active {
transform: translateY(0) scale(0.99);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10);
}
/* ===================== */
/* LOGO */
/* ===================== */
.logo {
width: 44px;
height: 44px;
/* NOTEBOOKS 12001399px */
@media (min-width: 1200px) and (max-width: 1399.98px) {
width: 38px;
height: 38px;
}
@media (max-width: 1280px) {
width: 38px;
height: 38px;
}
@media (max-width: 1024px) {
width: 30px;
height: 30px;
width: 28px;
height: 28px;
}
@media (max-width: 480px) {
@ -155,330 +72,270 @@
display: flex;
align-items: center;
gap: 8px;
text-decoration: none;
color: inherit;
cursor: pointer;
transition: transform 180ms ease, filter 180ms ease;
}
.logo-area:hover {
transform: translateY(-1px);
filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.10));
text-decoration: none; /* ⬅️ tira sublinhado */
color: inherit; /* ⬅️ usa as cores definidas nos spans */
cursor: pointer; /* ⬅️ deixa com “carinha” de botão/link */
}
/* TEXTO DA LOGO */
.logo-text {
white-space: nowrap;
}
.logo-text .line,
.logo-text .gestao {
font-weight: 800;
font-size: 32px;
font-weight: 600;
font-size: 32px; /* desktop grande */
@media (max-width: 1280px) { font-size: 26px; }
@media (max-width: 1100px) { font-size: 22px; }
@media (max-width: 1024px) { font-size: 18px; }
@media (max-width: 900px) { font-size: 17px; }
@media (max-width: 768px) { font-size: 16px; }
/* NOTEBOOKS 12001399px */
@media (min-width: 1200px) and (max-width: 1399.98px) {
font-size: 26px;
}
@media (max-width: 1200px) {
font-size: 19px;
}
@media (max-width: 1024px) {
font-size: 18px;
}
@media (max-width: 900px) {
font-size: 17px;
}
@media (max-width: 768px) {
font-size: 16px;
}
@media (max-width: 480px) {
font-size: 15px;
}
}
.logo-text .line { color: var(--blue); }
.logo-text .line { color: #030FAA; }
.logo-text .gestao { color: #000000; }
/* ===================== */
/* MENU (HOME) */
/* MENU */
/* ===================== */
.menu {
display: flex;
align-items: center;
gap: 24px;
/* ✅ nunca quebrar linha */
flex-wrap: nowrap;
white-space: nowrap;
overflow: hidden;
@media (max-width: 1200px) {
gap: 18px;
}
/* ✅ não empurrar botões */
flex: 1 1 auto;
min-width: 0;
@media (max-width: 1024px) {
gap: 14px;
}
gap: 18px;
@media (max-width: 900px) {
gap: 12px;
}
@media (max-width: 1280px) { gap: 14px; }
@media (max-width: 1100px) { gap: 12px; }
@media (max-width: 1024px) { gap: 10px; }
@media (max-width: 768px) {
gap: 10px;
}
/* telas menores: some o menu */
@media (max-width: 992px) {
display: none;
@media (max-width: 600px) {
flex-wrap: wrap;
justify-content: center;
gap: 10px;
width: 100%;
}
}
.menu-item {
font-family: 'Poppins', sans-serif;
font-size: 15px;
font-weight: 700;
color: rgba(0, 0, 0, 0.78) !important;
font-size: 16px;
font-weight: 600;
color: #000 !important;
text-decoration: none !important;
padding: 10px 10px;
border-radius: 12px;
/* NOTEBOOKS 12001399px */
@media (min-width: 1200px) and (max-width: 1399.98px) {
font-size: 14.5px;
}
white-space: nowrap;
@media (max-width: 1200px) {
font-size: 14px;
}
transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
@media (max-width: 1024px) {
font-size: 13.5px;
}
@media (max-width: 1280px) { font-size: 13px; padding: 9px 9px; }
@media (max-width: 1100px) { font-size: 12.5px; padding: 8px 8px; }
@media (max-width: 1024px) { font-size: 12px; padding: 8px 8px; }
@media (max-width: 900px) {
font-size: 13px;
}
@media (max-width: 768px) {
font-size: 12.5px;
}
@media (max-width: 600px) {
font-size: 12px;
}
}
.menu-item:hover {
transform: translateY(-1px);
background: rgba(227, 61, 207, 0.08);
box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
color: #030FAA !important;
}
/* ===================== */
/* BOTÕES (HOME) */
/* BOTÕES */
/* ===================== */
.btn-area {
display: flex;
align-items: center;
gap: 12px;
flex: 0 0 auto;
margin-left: 0 !important;
@media (max-width: 1100px) { gap: 10px; }
}
.btn-cadastrar,
.btn-login {
width: 164px;
height: 41px;
border-radius: 14px;
font-size: 15px;
font-weight: 800;
border: 1px solid rgba(0, 0, 0, 0.10);
cursor: pointer;
transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
@media (max-width: 1280px) {
width: 150px;
height: 40px;
@media (max-width: 900px) {
gap: 10px;
}
@media (max-width: 1100px) {
@media (max-width: 600px) {
width: 100%;
justify-content: center;
}
}
/* --- Botão Cadastre-se --- */
.btn-cadastrar {
width: 164px;
height: 41px;
background: #E1E1E1;
border-radius: 8px;
color: #000;
font-size: 16px;
font-weight: 600;
border: none;
cursor: pointer;
transition: background-color 0.15s ease, transform 0.08s ease;
@media (min-width: 1200px) and (max-width: 1399.98px) {
width: 140px;
height: 38px;
height: 36px;
font-size: 14px;
}
@media (max-width: 1024px) {
width: 132px;
width: 140px;
height: 36px;
font-size: 13px;
}
@media (max-width: 992px) {
width: 150px;
height: 40px;
font-size: 14px;
}
@media (max-width: 900px) {
width: 135px;
height: 36px;
font-size: 14px;
}
@media (max-width: 768px) {
width: 120px;
height: 34px;
font-size: 13px;
}
@media (max-width: 600px) {
width: 46vw;
max-width: 190px;
width: 45%;
}
}
.btn-cadastrar {
background: #E1E1E1; /* ✅ sólido (sem transparência) */
color: #000;
.btn-cadastrar:hover {
background: #d7d7d7;
}
.btn-cadastrar:active {
background: rgba(225, 225, 225, 0.7) !important;
transform: scale(0.98);
}
/* --- Botão Login --- */
.btn-login {
background: var(--brand);
border-color: var(--brand);
width: 164px;
height: 41px;
background: #E33DCF;
border-radius: 8px;
color: #fff;
font-size: 16px;
font-weight: 600;
border: none;
cursor: pointer;
transition: background-color 0.15s ease, transform 0.08s ease;
@media (min-width: 1200px) and (max-width: 1399.98px) {
width: 140px;
height: 36px;
font-size: 14px;
}
@media (max-width: 1024px) {
width: 150px;
height: 38px;
font-size: 15px;
}
@media (max-width: 900px) {
width: 135px;
height: 36px;
font-size: 14px;
}
@media (max-width: 768px) {
width: 120px;
height: 34px;
font-size: 13px;
}
@media (max-width: 600px) {
width: 45%;
}
}
/* garante que o texto SEMPRE fique branco */
.btn-login,
.btn-login:hover,
.btn-login:active,
.btn-login:focus {
color: #fff !important;
}
.btn-cadastrar:hover,
.btn-login:hover {
transform: translateY(-2px);
box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
background: #d72bd0;
}
.btn-login:hover {
filter: brightness(0.97);
.btn-login:active {
background: rgba(227, 61, 207, 0.8) !important;
transform: scale(0.98);
}
/* ===================== */
/* FAIXA (HOME) */
/* FAIXA AZUL INFERIOR */
/* ===================== */
.header-bar {
width: 100%;
height: 34px;
height: 38.41px;
background: rgba(3, 15, 170, 0.93);
display: flex;
align-items: center;
justify-content: center;
@media (max-width: 480px) {
height: 30px;
height: 34px;
}
}
/* degradê igual ao footer */
.footer-gradient {
background: linear-gradient(90deg, #0B2BD6 0%, #6A55FF 40%, #E33DCF 100%);
}
.header-bar-text {
color: #ffffff;
font-size: 15px;
font-weight: 800;
font-family: 'Poppins', sans-serif;
font-size: 16px;
font-weight: 700;
@media (max-width: 480px) { font-size: 13px; }
}
/* ===================================================== */
/* MENU LATERAL (GERAL) */
/* ===================================================== */
.menu-overlay {
position: fixed;
inset: 0;
z-index: 1100;
background: rgba(0, 0, 0, 0.35);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
}
.side-menu {
position: fixed;
top: 0;
left: 0;
height: 100vh;
width: min(340px, 88vw);
z-index: 1150;
transform: translateX(-102%);
transition: transform 220ms ease;
background: rgba(255, 255, 255, 0.82);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
border-right: 1px solid rgba(227, 61, 207, 0.18);
box-shadow: 0 24px 60px rgba(0, 0, 0, 0.14);
display: flex;
flex-direction: column;
}
.side-menu.open { transform: translateX(0); }
.side-menu-header {
padding: 14px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.close-btn {
width: 44px;
height: 44px;
border-radius: 12px;
border: 1px solid rgba(0, 0, 0, 0.10);
background: rgba(255, 255, 255, 0.60);
display: grid;
place-items: center;
cursor: pointer;
transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.close-btn:hover {
transform: translateY(-1px);
box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}
.close-btn:active {
transform: translateY(0) scale(0.99);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10);
}
.side-menu-body {
padding: 12px;
overflow: auto;
}
.side-item {
display: flex;
align-items: center;
gap: 10px;
width: 100%;
padding: 12px 12px;
border-radius: 14px;
text-decoration: none;
color: rgba(0, 0, 0, 0.80);
font-weight: 800;
font-family: 'Poppins', sans-serif;
transition: background 180ms ease, transform 180ms ease;
}
.side-item i { color: var(--brand); }
.side-item:hover {
background: rgba(227, 61, 207, 0.10);
transform: translateY(-1px);
}
.side-item:active {
transform: translateY(0) scale(0.99);
}
/* ========================================= */
/* ✅ OVERRIDE BOOTSTRAP: SEM TRANSPARÊNCIA */
/* ========================================= */
.btn.btn-cadastrar,
.btn.btn-login {
-webkit-tap-highlight-color: transparent;
}
.btn.btn-cadastrar:active,
.btn.btn-login:active,
.btn.btn-cadastrar:active:focus,
.btn.btn-login:active:focus,
.btn.btn-cadastrar:focus,
.btn.btn-login:focus,
.btn.btn-cadastrar:focus-visible,
.btn.btn-login:focus-visible {
opacity: 1 !important;
filter: none !important;
}
/* mantém as cores originais até quando clica */
.btn.btn-cadastrar:active { background: #E1E1E1 !important; }
.btn.btn-login:active { background: var(--brand) !important; border-color: var(--brand) !important; color: #fff !important; }
/* remove “inset” do bootstrap */
.btn.btn-cadastrar:active,
.btn.btn-login:active {
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10) !important;
/* NOTEBOOKS 12001399px */
@media (min-width: 1200px) and (max-width: 1399.98px) {
font-size: 15px;
}
@media (max-width: 480px) {
font-size: 14px;
}
}

View File

@ -1,61 +1,11 @@
import { Component, HostListener, Inject } from '@angular/core';
import { RouterLink, Router, NavigationEnd } from '@angular/router';
import { CommonModule, isPlatformBrowser } from '@angular/common';
import { PLATFORM_ID } from '@angular/core';
import { Component } from '@angular/core';
import { RouterLink } from '@angular/router';
@Component({
selector: 'app-header',
standalone: true,
imports: [RouterLink, CommonModule],
standalone: true, // ⬅️ importante para usar `imports` aqui
imports: [RouterLink], // ⬅️ habilita o uso de routerLink no template
templateUrl: './header.html',
styleUrls: ['./header.scss'],
styleUrl: './header.scss',
})
export class Header {
isScrolled = false;
isHome = true;
// ✅ menu hamburguer
menuOpen = false;
// ✅ define quando mostrar header “logado”
isLoggedHeader = false;
constructor(
private router: Router,
@Inject(PLATFORM_ID) private platformId: object
) {
this.router.events.subscribe((event) => {
if (event instanceof NavigationEnd) {
const url = event.urlAfterRedirects || event.url;
this.isHome = (url === '/' || url === '');
// ✅ considera header logado quando está em /geral
this.isLoggedHeader = url.startsWith('/geral');
// ✅ ao trocar de rota, fecha o menu
this.menuOpen = false;
}
});
}
toggleMenu() {
this.menuOpen = !this.menuOpen;
}
closeMenu() {
this.menuOpen = false;
}
@HostListener('window:scroll', [])
onWindowScroll() {
if (!isPlatformBrowser(this.platformId)) return;
this.isScrolled = window.scrollY > 10;
}
@HostListener('document:keydown.escape', [])
onEsc() {
if (!isPlatformBrowser(this.platformId)) return;
this.closeMenu();
}
}
export class Header { }

View File

@ -1,21 +0,0 @@
import { inject, PLATFORM_ID } from '@angular/core';
import { CanActivateFn, Router } from '@angular/router';
import { isPlatformBrowser } from '@angular/common';
export const authGuard: CanActivateFn = () => {
const router = inject(Router);
const platformId = inject(PLATFORM_ID);
// SSR: não existe localStorage. Bloqueia e manda pro login.
if (!isPlatformBrowser(platformId)) {
return router.parseUrl('/login');
}
const token = localStorage.getItem('token');
if (!token) {
return router.parseUrl('/login');
}
return true;
};

View File

@ -1,15 +0,0 @@
import { HttpInterceptorFn } from '@angular/common/http';
export const authInterceptor: HttpInterceptorFn = (req, next) => {
// ✅ SSR-safe
if (typeof window === 'undefined') return next(req);
const token = localStorage.getItem('token');
if (!token) return next(req);
return next(
req.clone({
setHeaders: { Authorization: `Bearer ${token}` }
})
);
};

View File

@ -1,443 +0,0 @@
<div class="toast-container position-fixed top-0 end-0 p-3" style="z-index: 10000;">
<div #successToast class="toast text-bg-success border-0 shadow" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header border-bottom-0">
<strong class="me-auto text-primary">LineGestão</strong>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Fechar"></button>
</div>
<div class="toast-body bg-white rounded-bottom text-dark">
{{ toastMessage }}
</div>
</div>
</div>
<section class="geral-page" (click)="closeClientDropdown()">
<span class="page-blob blob-1" aria-hidden="true"></span>
<span class="page-blob blob-2" aria-hidden="true"></span>
<span class="page-blob blob-3" aria-hidden="true"></span>
<span class="page-blob blob-4" aria-hidden="true"></span>
<div class="container-geral">
<div class="geral-card" data-animate>
<div class="geral-header">
<div class="header-row-top">
<div class="title-badge" data-animate>
<i class="bi bi-grid-1x2"></i> Gestão centralizada
</div>
<div class="header-title" data-animate>
<h5 class="title mb-0">Geral</h5>
<small class="subtitle">Tabela de linhas e dados de telefonia</small>
</div>
<div class="header-actions d-flex gap-2 justify-content-end" data-animate>
<button type="button" class="btn btn-glass btn-sm" (click)="onImportExcel()" [disabled]="loading">
<i class="bi bi-file-earmark-excel me-1"></i> Importar
</button>
<input #excelInput type="file" class="d-none" accept=".xlsx" (change)="onExcelSelected($event)" />
<button type="button" class="btn btn-brand btn-sm" (click)="onCadastrarLinha()" [disabled]="loading">
<i class="bi bi-plus-circle me-1"></i> Nova Linha
</button>
</div>
</div>
<div class="filters-row mt-4" data-animate>
<div class="filter-tabs">
<button type="button" class="filter-tab" [class.active]="filterSkil === 'ALL'" (click)="setFilter('ALL')" [disabled]="loading">
Todos
</button>
<button type="button" class="filter-tab" [class.active]="filterSkil === 'PF'" (click)="setFilter('PF')" [disabled]="loading">
<i class="bi bi-person me-1"></i> Pessoa Física
</button>
<button type="button" class="filter-tab" [class.active]="filterSkil === 'PJ'" (click)="setFilter('PJ')" [disabled]="loading">
<i class="bi bi-building me-1"></i> Pessoa Jurídica
</button>
<button type="button" class="filter-tab" [class.active]="filterSkil === 'RESERVA'" (click)="setFilter('RESERVA')" [disabled]="loading">
<i class="bi bi-archive me-1"></i> Reservas
</button>
</div>
<div class="client-filter-wrap" (click)="$event.stopPropagation()">
<button type="button" class="btn-client-filter" [class.active]="selectedClient" (click)="toggleClientMenu()" [disabled]="loading">
<i class="bi bi-people-fill me-2" *ngIf="!selectedClient"></i>
<span class="text-truncate" style="max-width: 150px;">
{{ selectedClient ? selectedClient : 'Clientes' }}
</span>
<i class="bi bi-chevron-down ms-2 small"></i>
</button>
<div class="client-dropdown" *ngIf="showClientMenu">
<div class="dropdown-header-search">
<input type="text" class="form-control form-control-sm" placeholder="Buscar na lista..." [(ngModel)]="clientSearchTerm" autofocus>
</div>
<div class="dropdown-list">
<div class="dropdown-item-custom" [class.selected]="!selectedClient" (click)="selectClient(null)">
<i class="bi bi-grid me-2"></i> Todos os Clientes
</div>
<ng-container *ngFor="let client of filteredClientsList">
<div class="dropdown-item-custom" [class.selected]="client === selectedClient" (click)="selectClient(client)">
{{ client }}
</div>
</ng-container>
<div class="p-3 text-center text-muted small" *ngIf="filteredClientsList.length === 0">
Nenhum cliente encontrado.
</div>
</div>
</div>
</div>
</div>
<div class="controls mt-3" data-animate>
<div class="input-group input-group-sm search-group">
<span class="input-group-text">
<i class="bi" [class.bi-search]="!loading" [class.bi-hourglass-split]="loading" [class.text-brand]="loading"></i>
</span>
<input class="form-control"
placeholder="Pesquisar..."
[(ngModel)]="searchTerm"
(ngModelChange)="onSearch()" />
<button class="btn btn-outline-secondary btn-clear" type="button" (click)="clearSearch()" *ngIf="searchTerm">
<i class="bi bi-x-lg"></i>
</button>
</div>
<div class="page-size">
<span class="text-muted small fw-bold">Itens:</span>
<select class="form-select form-select-sm select-glass" [(ngModel)]="pageSize" (change)="onPageSizeChange()" [disabled]="loading">
<option [ngValue]="10">10</option>
<option [ngValue]="20">20</option>
<option [ngValue]="50">50</option>
<option [ngValue]="100">100</option>
</select>
</div>
</div>
</div>
<div class="geral-body">
<div class="groups-container" *ngIf="isGroupMode; else tableView">
<div class="text-center p-5" *ngIf="loading">
<span class="spinner-border text-brand"></span>
</div>
<div class="group-list" *ngIf="!loading">
<div *ngFor="let group of clientGroups" class="client-group-card" [class.expanded]="expandedGroup === group.cliente">
<div class="group-header" (click)="toggleGroup(group.cliente)">
<div class="group-info">
<h6 class="mb-0 fw-bold text-dark">{{ group.cliente }}</h6>
<div class="group-badges">
<span class="badge-pill total">{{ group.totalLinhas }} Linhas</span>
<span class="badge-pill active" *ngIf="group.ativos > 0">{{ group.ativos }} Ativas</span>
<span class="badge-pill blocked" *ngIf="group.bloqueados > 0">{{ group.bloqueados }} Bloq.</span>
</div>
</div>
<div class="group-toggle-icon"><i class="bi bi-chevron-down"></i></div>
</div>
<div class="group-body" *ngIf="expandedGroup === group.cliente">
<div class="table-wrap inner-table-wrap">
<div *ngIf="loadingLines" class="p-4 text-center text-muted">
<span class="spinner-border spinner-border-sm me-2"></span> Carregando linhas...
</div>
<table class="table table-modern align-middle text-center mb-0" *ngIf="!loadingLines">
<thead>
<tr>
<th>ITEM</th><th>LINHA</th><th>USUÁRIO</th><th>STATUS</th><th>VENCIMENTO</th><th>AÇÕES</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let r of groupLines" class="table-row-item">
<td class="text-muted fw-bold">{{ r.item }}</td>
<td class="fw-black text-blue">{{ r.linha }}</td>
<td class="text-dark">{{ r.usuario || '-' }}</td>
<td><span class="status-pill" [ngClass]="statusClass(r.status)">{{ statusLabel(r.status) }}</span></td>
<td class="text-muted small fw-bold">{{ r.contrato }}</td>
<td>
<div class="action-group justify-content-center">
<button type="button" class="btn-icon" (click)="onDetalhes(r)" title="Detalhes"><i class="bi bi-eye"></i></button>
<button type="button" class="btn-icon success" (click)="onFinanceiro(r)" title="Financeiro"><i class="bi bi-cash-coin"></i></button>
<button type="button" class="btn-icon primary" (click)="onEditar(r)" title="Editar"><i class="bi bi-pencil-square"></i></button>
<button type="button" class="btn-icon danger" (click)="onRemover(r, true)" title="Remover"><i class="bi bi-trash"></i></button>
</div>
</td>
</tr>
<tr *ngIf="groupLines.length === 0">
<td colspan="6" class="p-3 text-muted">Nenhuma linha encontrada neste grupo.</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="text-center text-muted mt-5" *ngIf="clientGroups.length === 0">
<i class="bi bi-inbox fs-1 d-block mb-2 opacity-50"></i> Nenhum grupo encontrado.
</div>
</div>
</div>
<ng-template #tableView>
<div class="table-wrap">
<table class="table table-modern align-middle text-center">
<colgroup>
<col style="width: 80px;">
<col style="width: 140px;">
<col style="width: 280px;">
<col style="width: 160px;">
<col style="width: 130px;">
<col style="width: 130px;">
<col style="width: 160px;">
</colgroup>
<thead>
<tr>
<th class="sortable text-center" (click)="setSort('item')">
<div class="th-content justify-content-center">ITEM <span class="sort-caret" [class.active]="sortKey==='item'">{{ sortKey==='item' && sortDir==='desc' ? '▼' : '▲' }}</span></div>
</th>
<th class="sortable text-center" (click)="setSort('linha')">
<div class="th-content justify-content-center">LINHA <span class="sort-caret" [class.active]="sortKey==='linha'">{{ sortKey==='linha' && sortDir==='desc' ? '▼' : '▲' }}</span></div>
</th>
<th class="sortable text-center" (click)="setSort('cliente')">
<div class="th-content justify-content-center">CLIENTE <span class="sort-caret" [class.active]="sortKey==='cliente'">{{ sortKey==='cliente' && sortDir==='desc' ? '▼' : '▲' }}</span></div>
</th>
<th class="sortable text-center" (click)="setSort('status')">
<div class="th-content justify-content-center">STATUS <span class="sort-caret" [class.active]="sortKey==='status'">{{ sortKey==='status' && sortDir==='desc' ? '▼' : '▲' }}</span></div>
</th>
<th class="sortable text-center" (click)="setSort('skil')">
<div class="th-content justify-content-center">SKIL <span class="sort-caret" [class.active]="sortKey==='skil'">{{ sortKey==='skil' && sortDir==='desc' ? '▼' : '▲' }}</span></div>
</th>
<th class="sortable text-center" (click)="setSort('contrato')">
<div class="th-content justify-content-center">VENCIMENTO <span class="sort-caret" [class.active]="sortKey==='contrato'">{{ sortKey==='contrato' && sortDir==='desc' ? '▼' : '▲' }}</span></div>
</th>
<th class="text-center">AÇÕES</th>
</tr>
</thead>
<tbody>
<tr *ngIf="loading">
<td colspan="7" class="text-center py-5 empty-state"><span class="spinner-border spinner-border-sm me-2 text-brand"></span> Carregando...</td>
</tr>
<tr *ngFor="let r of pagedRows; trackBy: trackById" class="table-row-item">
<td class="text-center text-muted fw-bold">{{ r.item }}</td>
<td class="text-center fw-black text-blue">{{ r.linha }}</td>
<td class="text-center fw-bold text-dark td-clip" [title]="r.cliente">{{ r.cliente }}</td>
<td class="text-center">
<span class="status-pill" [ngClass]="statusClass(r.status)" [title]="r.status || ''">{{ statusLabel(r.status) }}</span>
</td>
<td class="text-center fw-bold text-muted small">{{ r.skil }}</td>
<td class="text-center fw-bold text-muted small">{{ r.contrato }}</td>
<td class="text-center">
<div class="action-group justify-content-center">
<button type="button" class="btn-icon" (click)="onDetalhes(r)" title="Detalhes"><i class="bi bi-eye"></i></button>
<button type="button" class="btn-icon success" (click)="onFinanceiro(r)" title="Financeiro"><i class="bi bi-cash-coin"></i></button>
<button type="button" class="btn-icon primary" (click)="onEditar(r)" title="Editar"><i class="bi bi-pencil-square"></i></button>
<button type="button" class="btn-icon danger" (click)="onRemover(r)"><i class="bi bi-trash"></i></button>
</div>
</td>
</tr>
<tr *ngIf="!loading && pagedRows.length === 0">
<td colspan="7" class="text-center py-5 empty-state">Nenhum registro encontrado.</td>
</tr>
</tbody>
</table>
</div>
</ng-template>
</div>
<div class="geral-footer">
<div class="small text-muted fw-bold">Mostrando {{ pageStart }}{{ pageEnd }} de {{ filteredCount }}</div>
<nav>
<ul class="pagination pagination-sm mb-0 pagination-modern">
<li class="page-item" [class.disabled]="page === 1 || loading"><button class="page-link" (click)="goToPage(page - 1)">Anterior</button></li>
<li class="page-item" *ngFor="let p of pageNumbers" [class.active]="p === page"><button class="page-link" (click)="goToPage(p)">{{ p }}</button></li>
<li class="page-item" [class.disabled]="page === totalPages || loading"><button class="page-link" (click)="goToPage(page + 1)">Próxima</button></li>
</ul>
</nav>
</div>
</div>
</div>
</section>
<div class="modal-backdrop-custom" *ngIf="detailOpen || financeOpen || editOpen" (click)="closeDetail(); closeFinance(); closeEdit()"></div>
<div class="modal-custom" *ngIf="detailOpen">
<div class="modal-card modal-responsive" (click)="$event.stopPropagation()">
<div class="modal-header">
<div class="modal-title"><span class="icon-bg primary-soft"><i class="bi bi-sim"></i></span> Detalhes da Linha</div>
<button type="button" class="btn btn-sm btn-icon" (click)="closeDetail()"><i class="bi bi-x-lg"></i></button>
</div>
<div class="modal-body modern-body bg-light-gray" *ngIf="detailData; else detailLoading">
<div class="details-dashboard">
<div class="dashboard-column">
<div class="detail-box">
<div class="box-header"><i class="bi bi-person-badge me-2"></i> Identificação</div>
<div class="box-body compact">
<div class="row-item"><span class="lbl">LINHA</span><span class="val text-blue fs-5">{{ detailData.linha || '-' }}</span></div>
<div class="row-item"><span class="lbl">CLIENTE</span><span class="val text-end text-truncate" style="max-width: 250px;" [title]="detailData.cliente">{{ detailData.cliente || '-' }}</span></div>
<div class="row-item"><span class="lbl">USUÁRIO</span><span class="val">{{ detailData.usuario || '-' }}</span></div>
<div class="divider small"></div>
<div class="row-grid-2">
<div class="mini-item"><span class="lbl">ITEM</span><span class="val">{{ detailData.item }}</span></div>
<div class="mini-item text-end"><span class="lbl">CHIP</span><span class="val">{{ detailData.chip || '-' }}</span></div>
</div>
</div>
</div>
<div class="detail-box mt-3">
<div class="box-header"><i class="bi bi-file-earmark-text me-2"></i> Contrato & Plano</div>
<div class="box-body compact">
<div class="row-item"><span class="lbl">PLANO CONTRATO</span><span class="val fw-bold">{{ detailData.planoContrato || '-' }}</span></div>
<div class="row-item"><span class="lbl">CONTA</span><span class="val">{{ detailData.conta || '-' }}</span></div>
<div class="row-item"><span class="lbl">VENC. DA CONTA</span><span class="val">{{ detailData.vencConta || '-' }}</span></div>
</div>
</div>
</div>
<div class="dashboard-column">
<div class="detail-box">
<div class="box-header"><i class="bi bi-activity me-2"></i> Status & Logística</div>
<div class="box-body compact">
<div class="row-item align-items-center"><span class="lbl">STATUS</span><span class="status-pill static" [ngClass]="statusClass(detailData.status)">{{ statusLabel(detailData.status) }}</span></div>
<div class="row-item"><span class="lbl">DATA DO BLOQUEIO</span><span class="val">{{ formatDateBr(detailData.dataBloqueio) }}</span></div>
<div class="row-item"><span class="lbl">MODALIDADE</span><span class="val">{{ detailData.modalidade || '-' }}</span></div>
<div class="divider small"></div>
<div class="row-item"><span class="lbl">DATA ENTREGA OPERA.</span><span class="val">{{ formatDateBr(detailData.dataEntregaOpera) }}</span></div>
<div class="row-item"><span class="lbl">DATA ENTREGA CLIENTE</span><span class="val">{{ formatDateBr(detailData.dataEntregaCliente) }}</span></div>
</div>
</div>
<div class="detail-box mt-3">
<div class="box-header"><i class="bi bi-sliders me-2"></i> Dados de Gestão</div>
<div class="box-body compact">
<div class="row-item"><span class="lbl">SKIL</span><span class="val">{{ detailData.skil || '-' }}</span></div>
<div class="row-item"><span class="lbl">CEDENTE</span><span class="val">{{ detailData.cedente || '-' }}</span></div>
<div class="row-item"><span class="lbl">SOLICITANTE</span><span class="val">{{ detailData.solicitante || '-' }}</span></div>
</div>
</div>
</div>
</div>
</div>
<ng-template #detailLoading><div class="p-5 text-center text-muted">Carregando detalhes...</div></ng-template>
</div>
</div>
<div class="modal-custom" *ngIf="financeOpen">
<div class="modal-card modal-lg" (click)="$event.stopPropagation()">
<div class="modal-header">
<div class="modal-title"><span class="icon-bg success"><i class="bi bi-wallet2"></i></span> Financeiro</div>
<button type="button" class="btn btn-sm btn-icon" (click)="closeFinance()"><i class="bi bi-x-lg"></i></button>
</div>
<div class="modal-body modern-body bg-light-gray" *ngIf="financeData; else financeLoading">
<div class="finance-dashboard">
<div class="finance-card vivo-card">
<div class="card-header-f"><i class="bi bi-telephone-fill me-2"></i> Vivo</div>
<div class="card-body-f">
<div class="row-item"><span>Franquia</span> <strong>{{ formatFranquia(financeData.franquiaVivo) }}</strong></div>
<div class="row-item"><span>Valor Plano</span> <strong>{{ formatMoney(financeData.valorPlanoVivo) }}</strong></div>
<div class="row-item"><span>Gestão Voz/Dados</span> <strong>{{ formatMoney(financeData.gestaoVozDados) }}</strong></div>
<div class="row-item"><span>Skeelo</span> <strong>{{ formatMoney(financeData.skeelo) }}</strong></div>
<div class="row-item"><span>Vivo News+</span> <strong>{{ formatMoney(financeData.vivoNewsPlus) }}</strong></div>
<div class="row-item"><span>Travel Mundo</span> <strong>{{ formatMoney(financeData.vivoTravelMundo) }}</strong></div>
<div class="row-item"><span>Gestão Disp.</span> <strong>{{ formatMoney(financeData.vivoGestaoDispositivo) }}</strong></div>
<div class="divider"></div>
<div class="row-item total"><span>Total Vivo</span> <strong>{{ formatMoney(financeData.valorContratoVivo) }}</strong></div>
</div>
</div>
<div class="finance-card line-card">
<div class="card-header-f"><i class="bi bi-hdd-network-fill me-2"></i> Line Móvel</div>
<div class="card-body-f">
<div class="row-item"><span>Franquia Line</span> <strong>{{ formatFranquia(financeData.franquiaLine) }}</strong></div>
<div class="row-item"><span>Franquia Gestão</span> <strong>{{ formatFranquia(financeData.franquiaGestao) }}</strong></div>
<div class="row-item"><span>Locação Ap.</span> <strong>{{ formatMoney(financeData.locacaoAp) }}</strong></div>
<div class="divider"></div>
<div class="row-item total"><span>Total Line</span> <strong>{{ formatMoney(financeData.valorContratoLine) }}</strong></div>
</div>
</div>
</div>
<div class="finance-summary mt-3">
<div class="summary-item"><span class="lbl">Desconto</span><span class="val text-success">{{ formatMoney(financeData.desconto) }}</span></div>
<div class="vertical-line"></div>
<div class="summary-item"><span class="lbl">Lucro Estimado</span><span class="val text-brand">{{ formatMoney(financeData.lucro) }}</span></div>
</div>
</div>
<ng-template #financeLoading><div class="p-5 text-center text-muted">Carregando financeiro...</div></ng-template>
</div>
</div>
<div class="modal-custom" *ngIf="editOpen">
<div class="modal-card modal-edit" (click)="$event.stopPropagation()">
<div class="modal-header">
<div class="modal-title"><span class="icon-bg primary-soft"><i class="bi bi-pencil-square"></i></span> Editar Linha</div>
<div class="d-flex align-items-center gap-2">
<button type="button" class="btn btn-glass btn-sm" (click)="closeEdit()" [disabled]="editSaving"><i class="bi bi-x-lg me-1"></i> Cancelar</button>
<button type="button" class="btn btn-brand btn-sm" (click)="saveEdit()" [disabled]="!editModel || editSaving">
<span *ngIf="!editSaving"><i class="bi bi-check2-circle me-1"></i> Salvar</span>
<span *ngIf="editSaving"><span class="spinner-border spinner-border-sm me-2"></span> Salvando...</span>
</button>
</div>
</div>
<div class="modal-body modern-body bg-light-gray">
<ng-container *ngIf="editModel; else editLoadingTpl">
<div class="edit-sections">
<details open class="edit-section"><summary><i class="bi bi-person-badge me-2"></i>Identificação</summary>
<div class="edit-grid">
<div class="form-field"><label>Item</label><input class="form-control form-control-sm" type="number" [(ngModel)]="editModel.item" name="edit_item" /></div>
<div class="form-field"><label>Conta</label><input class="form-control form-control-sm" [(ngModel)]="editModel.conta" name="edit_conta" /></div>
<div class="form-field"><label>Linha</label><input class="form-control form-control-sm" [(ngModel)]="editModel.linha" name="edit_linha" /></div>
<div class="form-field"><label>Chip</label><input class="form-control form-control-sm" [(ngModel)]="editModel.chip" name="edit_chip" /></div>
<div class="form-field"><label>Cliente</label><input class="form-control form-control-sm" [(ngModel)]="editModel.cliente" name="edit_cliente" /></div>
<div class="form-field"><label>Usuário</label><input class="form-control form-control-sm" [(ngModel)]="editModel.usuario" name="edit_usuario" /></div>
</div>
</details>
<details open class="edit-section"><summary><i class="bi bi-file-earmark-text me-2"></i>Contrato & Plano</summary>
<div class="edit-grid">
<div class="form-field span-2"><label>Plano Contrato</label><input class="form-control form-control-sm" [(ngModel)]="editModel.planoContrato" name="edit_planoContrato" /></div>
<div class="form-field"><label>Venc. da Conta</label><input class="form-control form-control-sm" [(ngModel)]="editModel.vencConta" name="edit_vencConta" /></div>
<div class="form-field"><label>Modalidade</label><input class="form-control form-control-sm" [(ngModel)]="editModel.modalidade" name="edit_modalidade" /></div>
</div>
</details>
<details open class="edit-section"><summary><i class="bi bi-activity me-2"></i>Status & Logística</summary>
<div class="edit-grid">
<div class="form-field"><label>Status</label><input class="form-control form-control-sm" [(ngModel)]="editModel.status" name="edit_status" /></div>
<div class="form-field"><label>Data do Bloqueio</label><input class="form-control form-control-sm" type="date" [(ngModel)]="editModel.dataBloqueio" name="edit_dataBloqueio" /></div>
<div class="form-field"><label>Data Entrega Operadora</label><input class="form-control form-control-sm" type="date" [(ngModel)]="editModel.dataEntregaOpera" name="edit_dataEntregaOpera" /></div>
<div class="form-field"><label>Data Entrega Cliente</label><input class="form-control form-control-sm" type="date" [(ngModel)]="editModel.dataEntregaCliente" name="edit_dataEntregaCliente" /></div>
<div class="form-field"><label>Skil</label><input class="form-control form-control-sm" [(ngModel)]="editModel.skil" name="edit_skil" /></div>
<div class="form-field"><label>Cedente</label><input class="form-control form-control-sm" [(ngModel)]="editModel.cedente" name="edit_cedente" /></div>
<div class="form-field"><label>Solicitante</label><input class="form-control form-control-sm" [(ngModel)]="editModel.solicitante" name="edit_solicitante" /></div>
</div>
</details>
<details class="edit-section"><summary><i class="bi bi-telephone-fill me-2"></i>Vivo</summary>
<div class="edit-grid">
<div class="form-field"><label>Franquia Vivo</label><input class="form-control form-control-sm" type="number" step="0.01" [(ngModel)]="editModel.franquiaVivo" name="edit_franquiaVivo" /></div>
<div class="form-field"><label>Valor Plano Vivo</label><input class="form-control form-control-sm" type="number" step="0.01" [(ngModel)]="editModel.valorPlanoVivo" name="edit_valorPlanoVivo" /></div>
<div class="form-field"><label>Gestão Voz/Dados</label><input class="form-control form-control-sm" type="number" step="0.01" [(ngModel)]="editModel.gestaoVozDados" name="edit_gestaoVozDados" /></div>
<div class="form-field"><label>Skeelo</label><input class="form-control form-control-sm" type="number" step="0.01" [(ngModel)]="editModel.skeelo" name="edit_skeelo" /></div>
<div class="form-field"><label>Vivo News+</label><input class="form-control form-control-sm" type="number" step="0.01" [(ngModel)]="editModel.vivoNewsPlus" name="edit_vivoNewsPlus" /></div>
<div class="form-field"><label>Vivo Travel Mundo</label><input class="form-control form-control-sm" type="number" step="0.01" [(ngModel)]="editModel.vivoTravelMundo" name="edit_vivoTravelMundo" /></div>
<div class="form-field"><label>Vivo Gestão Dispositivo</label><input class="form-control form-control-sm" type="number" step="0.01" [(ngModel)]="editModel.vivoGestaoDispositivo" name="edit_vivoGestaoDispositivo" /></div>
<div class="form-field"><label>Valor Contrato Vivo</label><input class="form-control form-control-sm" type="number" step="0.01" [(ngModel)]="editModel.valorContratoVivo" name="edit_valorContratoVivo" /></div>
</div>
</details>
<details class="edit-section"><summary><i class="bi bi-hdd-network-fill me-2"></i>Line Móvel</summary>
<div class="edit-grid">
<div class="form-field"><label>Franquia Line</label><input class="form-control form-control-sm" type="number" step="0.01" [(ngModel)]="editModel.franquiaLine" name="edit_franquiaLine" /></div>
<div class="form-field"><label>Franquia Gestão</label><input class="form-control form-control-sm" type="number" step="0.01" [(ngModel)]="editModel.franquiaGestao" name="edit_franquiaGestao" /></div>
<div class="form-field"><label>Locação Ap.</label><input class="form-control form-control-sm" type="number" step="0.01" [(ngModel)]="editModel.locacaoAp" name="edit_locacaoAp" /></div>
<div class="form-field"><label>Valor Contrato Line</label><input class="form-control form-control-sm" type="number" step="0.01" [(ngModel)]="editModel.valorContratoLine" name="edit_valorContratoLine" /></div>
</div>
</details>
<details class="edit-section"><summary><i class="bi bi-graph-up-arrow me-2"></i>Resultado</summary>
<div class="edit-grid">
<div class="form-field"><label>Desconto</label><input class="form-control form-control-sm" type="number" step="0.01" [(ngModel)]="editModel.desconto" name="edit_desconto" /></div>
<div class="form-field"><label>Lucro</label><input class="form-control form-control-sm" type="number" step="0.01" [(ngModel)]="editModel.lucro" name="edit_lucro" /></div>
</div>
</details>
</div>
</ng-container>
<ng-template #editLoadingTpl><div class="p-5 text-center text-muted"><span class="spinner-border spinner-border-sm me-2"></span> Carregando...</div></ng-template>
</div>
</div>
</div>

View File

@ -1,458 +0,0 @@
/* ========================================================== */
/* 1. VARIÁVEIS E CONFIGURAÇÕES GERAIS */
/* ========================================================== */
:host {
/* Paleta de Cores */
--brand: #E33DCF; /* Rosa da marca */
--blue: #030FAA; /* Azul da marca */
--text: #111214; /* Texto principal */
--muted: rgba(17, 18, 20, 0.65); /* Texto secundário */
/* Cores Específicas (Financeiro/Status) */
--bg-vivo: #fbf5fc;
--text-vivo: #8a2be2;
--bg-line: #f5f6ff;
--text-line: #030FAA;
--success-bg: rgba(25, 135, 84, 0.1);
--success-text: #198754;
--danger-bg: rgba(220, 53, 69, 0.1);
--danger-text: #dc3545;
/* Dimensões & Bordas */
--radius-xl: 22px;
--radius-lg: 16px;
--radius-md: 12px;
--shadow-card: 0 22px 46px rgba(17, 18, 20, 0.10);
--glass-bg: rgba(255, 255, 255, 0.82);
--glass-border: 1px solid rgba(227, 61, 207, 0.16);
display: block;
font-family: 'Inter', sans-serif;
color: var(--text);
}
/* ========================================================== */
/* 2. LAYOUT DA PÁGINA & BACKGROUND */
/* ========================================================== */
.geral-page {
min-height: 100vh;
padding: 24px 12px 90px;
display: flex;
justify-content: center;
position: relative;
overflow: hidden;
/* Fundo com Gradientes Suaves e modernos */
background:
radial-gradient(900px 420px at 20% 10%, rgba(227, 61, 207, 0.14), transparent 60%),
radial-gradient(820px 380px at 80% 30%, rgba(227, 61, 207, 0.08), transparent 60%),
linear-gradient(180deg, #ffffff 0%, #f5f5f7 70%);
/* Overlay sutil de ruído/textura (opcional, aqui usado como clareador) */
&::after {
content: ''; position: absolute; inset: 0; pointer-events: none;
background: rgba(255, 255, 255, 0.25);
}
}
/* Blobs Flutuantes (Animação de fundo) */
.page-blob {
position: fixed; pointer-events: none; border-radius: 999px;
filter: blur(34px); opacity: 0.55; z-index: 0;
background: radial-gradient(circle at 30% 30%, rgba(227,61,207,0.55), rgba(227,61,207,0.06));
animation: floaty 10s ease-in-out infinite;
&.blob-1 { width: 420px; height: 420px; top: -140px; left: -140px; }
&.blob-2 { width: 520px; height: 520px; top: -220px; right: -240px; animation-duration: 12s; }
&.blob-3 { width: 360px; height: 360px; bottom: -180px; left: 25%; animation-duration: 14s; }
&.blob-4 { width: 520px; height: 520px; bottom: -260px; right: -260px; animation-duration: 16s; opacity: .45; }
}
@keyframes floaty {
0% { transform: translate(0, 0) scale(1); }
50% { transform: translate(18px, 10px) scale(1.03); }
100% { transform: translate(0, 0) scale(1); }
}
.container-geral {
width: 100%; max-width: 1180px; position: relative; z-index: 1;
}
/* Card Principal (Container da Aplicação) */
.geral-card {
border-radius: var(--radius-xl);
overflow: hidden;
background: var(--glass-bg);
border: var(--glass-border);
backdrop-filter: blur(12px);
box-shadow: var(--shadow-card);
position: relative;
display: flex; flex-direction: column;
max-height: 85vh; /* Limita altura para scroll interno */
/* Borda interna brilhante */
&::before {
content: ''; position: absolute; inset: 1px; border-radius: calc(var(--radius-xl) - 1px);
pointer-events: none; border: 1px solid rgba(255, 255, 255, 0.65); opacity: 0.75;
}
}
/* ========================================================== */
/* 3. HEADER (GRID LAYOUT) */
/* ========================================================== */
.geral-header {
padding: 16px 24px;
border-bottom: 1px solid rgba(17, 18, 20, 0.06);
background: linear-gradient(180deg, rgba(227,61,207,0.06), rgba(255,255,255,0.2));
flex-shrink: 0;
}
/* GRID: Esquerda (1fr) | Centro (auto) | Direita (1fr) */
.header-row-top {
display: grid;
grid-template-columns: 1fr auto 1fr;
align-items: center;
gap: 12px;
@media (max-width: 768px) {
grid-template-columns: 1fr;
text-align: center;
gap: 16px;
.title-badge { justify-self: center; margin-bottom: 8px; }
.header-actions { justify-self: center; }
}
}
/* 1. Badge à esquerda */
.title-badge {
justify-self: start;
display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px;
border-radius: 999px; background: rgba(255, 255, 255, 0.78);
border: 1px solid rgba(227, 61, 207, 0.22); backdrop-filter: blur(10px);
color: var(--text); font-size: 13px; font-weight: 800;
i { color: var(--brand); }
}
/* 2. Título Centralizado */
.header-title {
justify-self: center;
display: flex; flex-direction: column; align-items: center; text-align: center;
}
.title { font-size: 26px; font-weight: 950; letter-spacing: -0.3px; color: var(--text); margin-top: 10px; margin-bottom: 0; }
.subtitle { color: rgba(17, 18, 20, 0.65); font-weight: 700; }
/* 3. Ações à Direita */
.header-actions {
justify-self: end;
}
/* Botões do Header */
.btn-brand {
background-color: var(--brand); border-color: var(--brand); color: #fff;
font-weight: 900; border-radius: 12px; transition: transform 0.2s, box-shadow 0.2s;
&:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(227, 61, 207, 0.25); filter: brightness(1.05); }
&:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
}
.btn-glass {
border-radius: 12px; font-weight: 900; background: rgba(255, 255, 255, 0.6);
border: 1px solid rgba(3, 15, 170, 0.25); color: var(--blue);
&:hover { transform: translateY(-2px); border-color: var(--brand); background: #fff; }
}
/* ========================================================== */
/* 4. FILTROS E DROPDOWN */
/* ========================================================== */
.filters-row {
display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap;
}
.filter-tabs {
display: flex; gap: 4px; padding: 4px;
background: rgba(255, 255, 255, 0.6);
border: 1px solid rgba(17, 18, 20, 0.08);
border-radius: 12px; backdrop-filter: blur(8px);
}
.filter-tab {
border: none; background: transparent; padding: 8px 16px; border-radius: 8px;
font-size: 0.85rem; font-weight: 700; color: var(--muted);
transition: all 0.2s ease; display: flex; align-items: center; gap: 6px;
&:hover { color: var(--text); background: rgba(255, 255, 255, 0.5); }
&.active { background: #fff; color: var(--brand); box-shadow: 0 2px 8px rgba(227, 61, 207, 0.15); }
&:disabled { opacity: 0.5; cursor: not-allowed; }
}
/* Dropdown de Clientes */
.client-filter-wrap { position: relative; }
.btn-client-filter {
display: flex; align-items: center; gap: 8px;
padding: 8px 16px; border-radius: 12px;
border: 1px solid rgba(17, 18, 20, 0.08);
background: rgba(255, 255, 255, 0.6);
color: var(--muted); font-weight: 700; font-size: 0.85rem;
backdrop-filter: blur(8px); transition: all 0.2s; white-space: nowrap;
&:hover { background: #fff; border-color: var(--blue); color: var(--blue); }
&.active { background: var(--blue); color: #fff; border-color: var(--blue); i { color: #fff; } }
}
.client-dropdown {
position: absolute; top: calc(100% + 8px); right: 0;
width: 280px; max-height: 350px;
background: #fff; border-radius: 12px;
box-shadow: 0 10px 30px rgba(0,0,0,0.15);
border: 1px solid rgba(17,18,20,0.08);
z-index: 50; display: flex; flex-direction: column; overflow: hidden;
animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }
.dropdown-header-search { padding: 8px; border-bottom: 1px solid rgba(0,0,0,0.05); background: #f9fafb; }
.dropdown-list { overflow-y: auto; max-height: 300px; }
.dropdown-item-custom {
padding: 10px 16px; font-size: 0.85rem; color: var(--text); cursor: pointer; border-bottom: 1px solid rgba(0,0,0,0.03); transition: background 0.1s;
&:hover { background: rgba(227,61,207,0.05); color: var(--brand); font-weight: 600; }
&.selected { background: rgba(3,15,170,0.08); color: var(--blue); font-weight: 700; }
}
/* ========================================================== */
/* 5. CONTROLES (SEARCH BAR) */
/* ========================================================== */
.controls {
display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
/* Estilo Moderno da Busca */
.search-group {
max-width: 225px;
border-radius: 12px;
overflow: hidden;
display: flex;
align-items: stretch;
background: #fff; /* Fundo Branco Sólido */
border: 1px solid rgba(17, 18, 20, 0.15); /* Borda Visível */
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
transition: all 0.2s ease;
&:focus-within {
border-color: var(--brand);
box-shadow: 0 4px 12px rgba(227, 61, 207, 0.15);
transform: translateY(-1px);
}
.input-group-text {
background: transparent;
border: none;
color: var(--muted);
padding-left: 14px;
padding-right: 8px;
display: flex; align-items: center;
i { font-size: 1rem; }
}
.form-control {
border: none;
background: transparent;
padding: 10px 0;
font-size: 0.9rem;
color: var(--text);
box-shadow: none;
&::placeholder { color: rgba(17, 18, 20, 0.4); font-weight: 500; }
&:focus { outline: none; }
}
.btn-clear {
background: transparent;
border: none;
color: var(--muted);
padding: 0 12px;
display: flex; align-items: center; cursor: pointer;
transition: color 0.2s;
&:hover { color: #dc3545; }
i { font-size: 1rem; }
}
}
/* Select de Paginação */
.select-glass {
border-radius: 12px;
background: #fff;
border: 1px solid rgba(17, 18, 20, 0.15);
color: var(--text);
font-weight: 600;
box-shadow: 0 2px 6px rgba(0,0,0,0.04);
padding: 8px 32px 8px 12px;
cursor: pointer;
transition: all 0.2s;
width: auto;
&:focus {
border-color: var(--brand);
box-shadow: 0 4px 12px rgba(227, 61, 207, 0.15);
outline: none;
}
}
/* ========================================================== */
/* 6. CORPO, GRUPOS (ACCORDION) & TABELA */
/* ========================================================== */
.geral-body {
padding: 0; background: transparent; flex: 1; overflow: hidden; display: flex; flex-direction: column;
}
.groups-container { padding: 16px; overflow-y: auto; height: 100%; }
.group-list { display: flex; flex-direction: column; gap: 12px; }
/* Cards de Grupo */
.client-group-card {
background: #fff; border-radius: 16px;
border: 1px solid rgba(17,18,20,0.08); overflow: hidden;
transition: all 0.3s ease;
&:hover { border-color: var(--brand); box-shadow: 0 4px 12px rgba(227,61,207,0.1); }
&.expanded { border-color: var(--brand); box-shadow: 0 8px 24px rgba(227,61,207,0.12); }
}
.group-header {
padding: 16px 24px; display: flex; justify-content: space-between; align-items: center;
cursor: pointer; background: linear-gradient(180deg, #fff, #fdfdfd);
&:hover .group-toggle-icon { color: var(--brand); }
}
.group-info { display: flex; flex-direction: column; gap: 6px; }
.group-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge-pill {
font-size: 0.7rem; padding: 4px 10px; border-radius: 99px; font-weight: 800; text-transform: uppercase;
&.total { background: rgba(3,15,170,0.1); color: var(--blue); }
&.active { background: var(--success-bg); color: var(--success-text); }
&.blocked { background: var(--danger-bg); color: var(--danger-text); }
}
.group-toggle-icon { font-size: 1.2rem; color: var(--muted); transition: transform 0.3s ease; }
.client-group-card.expanded .group-toggle-icon { transform: rotate(180deg); color: var(--brand); }
.group-body {
border-top: 1px solid rgba(17,18,20,0.06); background: #fbfbfc;
animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.inner-table-wrap { max-height: 450px; overflow-y: auto; }
/* Tabela */
.table-wrap { overflow-x: auto; overflow-y: auto; height: 100%; }
.table-modern {
width: 100%; min-width: 1000px; border-collapse: separate; border-spacing: 0;
thead th {
position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(8px);
border-bottom: 2px solid rgba(227, 61, 207, 0.15); padding: 12px;
color: rgba(17, 18, 20, 0.7); font-size: 0.8rem; font-weight: 950; letter-spacing: 0.05em; text-transform: uppercase;
white-space: nowrap; cursor: pointer; transition: color 0.2s; text-align: center !important;
&:hover { color: var(--brand); }
}
tbody tr {
transition: background-color 0.2s; border-bottom: 1px solid rgba(17,18,20,0.05);
&:hover { background-color: rgba(227, 61, 207, 0.05); }
td { border-bottom: 1px solid rgba(17,18,20,0.04); }
}
td { padding: 12px; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.875rem; color: var(--text); text-align: center !important; }
}
.th-content { display: flex; align-items: center; justify-content: center; gap: 4px; }
.sort-caret { display: inline-block; width: 14px; text-align: center; opacity: 0.3; &.active { opacity: 1; color: var(--brand); } }
.text-brand { color: var(--brand) !important; }
.text-blue { color: var(--blue) !important; }
.fw-black { font-weight: 950; }
.td-clip { overflow: hidden; text-overflow: ellipsis; max-width: 250px; }
.empty-state { background: rgba(255,255,255,0.4); }
.status-pill {
display: inline-block; vertical-align: middle; max-width: 100%; padding: 6px 14px;
border-radius: 999px; font-weight: 950; font-size: 0.75rem; letter-spacing: 0.3px; text-align: center; text-transform: uppercase;
border: 1px solid rgba(17,18,20,0.1); background: rgba(17,18,20,0.05); color: rgba(17,18,20,0.7);
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
&.is-active { background: rgba(25, 135, 84, 0.15); border-color: rgba(25, 135, 84, 0.25); color: #157347; }
&.is-blocked { background: rgba(220, 53, 69, 0.15); border-color: rgba(220, 53, 69, 0.25); color: #b02a37; }
}
/* Botões de Ação na Tabela */
.action-group { display: flex; justify-content: center; gap: 6px; }
.btn-icon {
width: 32px; height: 32px; border: none; background: transparent; border-radius: 8px;
display: flex; align-items: center; justify-content: center; color: rgba(17,18,20,0.5); transition: all 0.2s;
&:hover { background: rgba(17,18,20,0.05); color: var(--text); transform: translateY(-1px); }
&.success:hover { color: var(--success-text); background: var(--success-bg); }
&.primary:hover { color: var(--blue); background: rgba(3,15,170,0.1); }
&.danger:hover { color: var(--danger-text); background: var(--danger-bg); }
}
/* ========================================================== */
/* 7. FOOTER (PAGINAÇÃO) */
/* ========================================================== */
.geral-footer {
padding: 14px 24px; border-top: 1px solid rgba(17, 18, 20, 0.06);
display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; flex-shrink: 0;
@media (max-width: 768px) { justify-content: center; text-align: center; }
}
.pagination-modern .page-link {
color: var(--blue); font-weight: 900; border-radius: 10px; border: 1px solid rgba(17,18,20,0.1);
background: rgba(255,255,255,0.6); margin: 0 2px;
&:hover { transform: translateY(-1px); border-color: var(--brand); color: var(--brand); }
}
.pagination-modern .page-item.active .page-link { background-color: var(--blue); border-color: var(--blue); color: #fff; }
/* ========================================================== */
/* 8. MODAIS (Z-INDEX ALTO) */
/* ========================================================== */
.modal-backdrop-custom { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 9990; backdrop-filter: blur(4px); }
.modal-custom { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 9995; padding: 16px; }
.modal-card {
background: #ffffff; border: 1px solid rgba(255,255,255,0.8); border-radius: 20px;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); overflow: hidden; display: flex; flex-direction: column;
animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
width: min(850px, 100%); max-height: 90vh;
}
@keyframes modalPop { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header {
padding: 16px 24px; border-bottom: 1px solid rgba(0,0,0,0.06); background: #fff; display: flex; justify-content: space-between; align-items: center;
.modal-title { font-size: 1.1rem; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 12px; }
.icon-bg { width: 32px; height: 32px; border-radius: 10px; background: rgba(3, 15, 170, 0.1); color: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 16px; &.success { background: var(--success-bg); color: var(--success-text); } &.primary-soft { background: rgba(3, 15, 170, 0.1); color: var(--blue); } }
.btn-icon { color: var(--muted); background: transparent; font-size: 1.2rem; &:hover { color: var(--brand); transform: rotate(90deg); } }
}
.modal-body { padding: 24px; overflow-y: auto; &.bg-light-gray { background-color: #f8f9fa; } }
/* Estilos de conteúdo dos modais (Detalhes, Financeiro, Edit) - Mantidos para garantir consistência */
@media (min-width: 1441px) {
.modal-card.modal-responsive { width: min(1200px, 95%); height: 85vh; max-height: none; }
.detail-box .box-header { padding: 8px 16px; }
.detail-box .box-body.compact { padding: 10px 14px; }
.box-body.compact .row-item { margin-bottom: 4px; font-size: 0.85rem; }
.details-dashboard { gap: 16px; }
}
.details-dashboard { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; @media(max-width: 700px) { grid-template-columns: 1fr; } }
.detail-box { background: #fff; border-radius: 12px; border: 1px solid rgba(0,0,0,0.06); overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.02); height: 100%; .box-header { padding: 10px 16px; font-weight: 800; font-size: 0.85rem; background: #fdfdfd; border-bottom: 1px solid rgba(0,0,0,0.04); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; i { color: var(--blue); } } .box-body { padding: 16px; } .box-body.compact { padding: 12px 14px; } }
.row-item { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 0.9rem; color: var(--muted); .lbl { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px; } .val { color: var(--text); font-weight: 700; text-align: right; } }
.box-body.compact .row-item { margin-bottom: 6px; }
.row-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-item { display: flex; flex-direction: column; .lbl { font-size: 0.7rem; color: var(--muted); font-weight: 800; text-transform: uppercase; } .val { font-size: 0.9rem; color: var(--text); font-weight: 700; } }
.divider { height: 1px; background: rgba(0,0,0,0.06); margin: 12px 0; }
.divider.small { margin: 8px 0; }
.finance-dashboard { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; @media(max-width: 700px) { grid-template-columns: 1fr; } }
.finance-card { background: #fff; border-radius: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.04); overflow: hidden; &.vivo-card { border-top: 4px solid var(--brand); .card-header-f { color: var(--brand); background: var(--bg-vivo); } } &.line-card { border-top: 4px solid var(--blue); .card-header-f { color: var(--blue); background: var(--bg-line); } } }
.card-header-f { padding: 12px 16px; font-weight: 800; font-size: 0.95rem; display: flex; align-items: center; }
.card-body-f { padding: 16px; .row-item { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 0.85rem; color: var(--muted); strong { color: var(--text); font-weight: 700; } &.total { font-size: 1rem; color: var(--text); margin-top: 8px; margin-bottom: 0; strong { color: var(--text); font-weight: 900; } } } .divider { height: 1px; background: rgba(0,0,0,0.06); margin: 12px 0; } }
.finance-summary { background: #fff; border-radius: 16px; padding: 16px 24px; box-shadow: 0 2px 12px rgba(0,0,0,0.03); display: flex; align-items: center; justify-content: space-around; .summary-item { display: flex; flex-direction: column; align-items: center; .lbl { font-size: 0.75rem; text-transform: uppercase; font-weight: 800; color: var(--muted); } .val { font-size: 1.25rem; font-weight: 900; } } .vertical-line { width: 1px; height: 40px; background: rgba(0,0,0,0.08); } }
.text-success { color: var(--success-text) !important; }
.modal-card.modal-edit { width: min(1100px, 100%); }
.edit-sections { display: grid; gap: 12px; }
.edit-section { background: #fff; border: 1px solid rgba(0,0,0,0.06); border-radius: 16px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.03); summary { cursor: pointer; user-select: none; padding: 12px 16px; font-weight: 950; color: rgba(17,18,20,0.75); display: flex; align-items: center; background: linear-gradient(180deg, rgba(227,61,207,0.06), rgba(255,255,255,0.6)); border-bottom: 1px solid rgba(0,0,0,0.06); i { color: var(--blue); } } }
.edit-grid { padding: 14px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; @media (max-width: 700px) { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; gap: 6px; label { font-size: 0.75rem; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; color: rgba(17,18,20,0.65); } }
.form-field.span-2 { grid-column: span 2; @media (max-width: 700px) { grid-column: span 1; } }
.edit-section .form-control { border-radius: 12px; border: 1px solid rgba(17,18,20,0.12); background: rgba(255,255,255,0.85); &:focus { border-color: rgba(227,61,207,0.5); box-shadow: 0 0 0 2px rgba(227,61,207,0.12); } }

View File

@ -1,23 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { Geral } from './geral';
describe('Geral', () => {
let component: Geral;
let fixture: ComponentFixture<Geral>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [Geral]
})
.compileComponents();
fixture = TestBed.createComponent(Geral);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -1,635 +0,0 @@
import { Component, ElementRef, ViewChild, Inject, PLATFORM_ID, AfterViewInit, ChangeDetectorRef } from '@angular/core';
import { isPlatformBrowser, CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { HttpClient, HttpClientModule, HttpParams, HttpErrorResponse } from '@angular/common/http';
// Tipos e Interfaces
type SortDir = 'asc' | 'desc';
interface LineRow {
id: string;
item: string;
linha: string;
cliente: string;
usuario: string;
status: string;
skil: string;
contrato: string;
}
interface ApiPagedResult<T> {
page: number;
pageSize: number;
total: number;
items: T[];
}
interface ApiLineList {
id: string;
item: number;
linha: string | null;
cliente: string | null;
usuario: string | null;
vencConta: string | null;
status?: string | null;
skil?: string | null;
}
// Interface completa para Edição/Detalhes
interface ApiLineDetail {
id: string;
item: number;
conta?: string | null;
linha?: string | null;
chip?: string | null;
cliente?: string | null;
usuario?: string | null;
planoContrato?: string | null;
status?: string | null;
skil?: string | null;
modalidade?: string | null;
dataBloqueio?: string | null;
cedente?: string | null;
solicitante?: string | null;
dataEntregaOpera?: string | null;
dataEntregaCliente?: string | null;
vencConta?: string | null;
franquiaVivo?: number | null;
valorPlanoVivo?: number | null;
gestaoVozDados?: number | null;
skeelo?: number | null;
vivoNewsPlus?: number | null;
vivoTravelMundo?: number | null;
vivoGestaoDispositivo?: number | null;
valorContratoVivo?: number | null;
franquiaLine?: number | null;
franquiaGestao?: number | null;
locacaoAp?: number | null;
valorContratoLine?: number | null;
desconto?: number | null;
lucro?: number | null;
}
type UpdateMobileLineRequest = Omit<ApiLineDetail, 'id'>;
interface ClientGroupDto {
cliente: string;
totalLinhas: number;
ativos: number;
bloqueados: number;
}
@Component({
standalone: true,
imports: [CommonModule, FormsModule, HttpClientModule],
templateUrl: './geral.html',
styleUrls: ['./geral.scss']
})
export class Geral implements AfterViewInit {
// Toast & Upload
toastMessage = '';
@ViewChild('successToast', { static: false }) successToast!: ElementRef;
@ViewChild('excelInput') excelInput!: ElementRef<HTMLInputElement>;
constructor(
@Inject(PLATFORM_ID) private platformId: object,
private http: HttpClient,
private cdr: ChangeDetectorRef
) {}
private readonly apiBase = 'https://localhost:7205/api/lines';
loading = false;
// Dados
rows: LineRow[] = [];
clientGroups: ClientGroupDto[] = []; // Cards de Clientes
groupLines: LineRow[] = []; // Linhas internas do Card (Accordion)
// Controle de Estado
expandedGroup: string | null = null;
loadingLines = false;
// Filtros
searchTerm = '';
filterSkil: 'ALL' | 'PF' | 'PJ' | 'RESERVA' = 'ALL';
// Dropdown de Clientes
clientsList: string[] = [];
selectedClient: string | null = null;
showClientMenu = false;
clientSearchTerm = '';
// Modo de Visualização: 'GROUPS' (Cards) ou 'TABLE' (Linhas)
viewMode: 'GROUPS' | 'TABLE' = 'GROUPS';
// Paginação e Ordenação
sortKey: keyof LineRow = 'item';
sortDir: SortDir = 'asc';
page = 1;
pageSize = 10;
total = 0;
// Modais
detailOpen = false;
financeOpen = false;
editOpen = false;
editSaving = false;
detailData: any = null;
financeData: any = null;
editModel: any = null;
private editingId: string | null = null;
private searchTimer: any = null;
// Getter auxiliar para o HTML saber se exibe os grupos
get isGroupMode(): boolean {
return this.viewMode === 'GROUPS';
}
async ngAfterViewInit() {
if (!isPlatformBrowser(this.platformId)) return;
this.initAnimations();
setTimeout(() => {
this.refreshData();
this.loadClients();
// Verifica se houve redirecionamento com mensagem de toast
const state = history.state;
if (state && state.toastMessage) {
const msg = String(state.toastMessage);
const newState = { ...state };
delete newState.toastMessage;
history.replaceState(newState, '', location.href);
this.showToast(msg);
}
});
}
private initAnimations() {
document.documentElement.classList.add('js-animate');
setTimeout(() => {
const items = document.querySelectorAll<HTMLElement>('[data-animate]');
items.forEach(el => el.classList.add('is-visible'));
}, 100);
}
// ==========================================================
// LÓGICA PRINCIPAL DE DADOS
// ==========================================================
refreshData() {
// Se um cliente específico foi selecionado no dropdown, força modo TABELA
if (this.selectedClient) {
this.viewMode = 'TABLE';
this.loadFromApi();
return;
}
// Se não, respeita o modo definido pela busca ou padrão
if (this.viewMode === 'GROUPS') {
this.loadGroups();
} else {
this.loadFromApi();
}
}
/**
* Lógica de Pesquisa Inteligente:
* - Se contém números -> Busca Linha/Chip -> Modo TABELA
* - Se é texto -> Busca Nome Cliente -> Modo GRUPOS (Cards)
*/
onSearch() {
if (this.searchTimer) clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.page = 1; // Reseta paginação ao pesquisar
const s = this.searchTerm.trim();
if (!s) {
// Busca vazia -> Volta para o padrão (Grupos)
this.viewMode = 'GROUPS';
this.loadGroups();
return;
}
// Verifica se tem números (busca específica)
if (/\d/.test(s)) {
this.viewMode = 'TABLE';
this.loadFromApi();
} else {
// Texto -> Busca por cliente nos Grupos
this.viewMode = 'GROUPS';
this.loadGroups();
}
}, 300); // Debounce de 300ms
}
// Carrega os Cards (Grupos)
private loadGroups() {
this.loading = true;
let params = new HttpParams()
.set('page', String(this.page))
.set('pageSize', String(this.pageSize));
// Filtros de Aba
if (this.filterSkil === 'PF') params = params.set('skil', 'PESSOA FÍSICA');
else if (this.filterSkil === 'PJ') params = params.set('skil', 'PESSOA JURÍDICA');
else if (this.filterSkil === 'RESERVA') params = params.set('skil', 'RESERVA');
// Filtro de Busca Textual (Nome do Cliente)
if (this.searchTerm) params = params.set('search', this.searchTerm);
this.http.get<ApiPagedResult<ClientGroupDto>>(`${this.apiBase}/groups`, { params }).subscribe({
next: (res) => {
// Fallback: Se buscou texto, mas não retornou nenhum grupo de cliente,
// pode ser que o usuário esteja buscando o nome de um "Usuário da Linha".
// Nesse caso, tentamos buscar na tabela.
if (this.searchTerm && res.total === 0 && !/\d/.test(this.searchTerm)) {
this.viewMode = 'TABLE';
this.loadFromApi();
return;
}
this.clientGroups = res.items || [];
this.total = res.total; // Total de Grupos para paginação
this.loading = false;
},
error: () => {
this.loading = false;
this.showToast('Erro ao carregar grupos.');
}
});
}
// Expandir o Card do Cliente (Accordion)
toggleGroup(clientName: string) {
if (this.expandedGroup === clientName) {
this.expandedGroup = null; // Fecha se já estiver aberto
return;
}
this.expandedGroup = clientName;
this.groupLines = [];
this.loadingLines = true;
// Busca as linhas desse cliente específico
let params = new HttpParams()
.set('client', clientName)
.set('page', '1')
.set('pageSize', '500') // Carrega até 500 linhas na expansão
.set('sortBy', 'item')
.set('sortDir', 'asc');
// ✅ IMPORTANTE: Passa o filtro Skil ativo (Ex: Reserva)
if (this.filterSkil === 'PF') params = params.set('skil', 'PESSOA FÍSICA');
else if (this.filterSkil === 'PJ') params = params.set('skil', 'PESSOA JURÍDICA');
else if (this.filterSkil === 'RESERVA') params = params.set('skil', 'RESERVA');
this.http.get<ApiPagedResult<ApiLineList>>(this.apiBase, { params }).subscribe({
next: (res) => {
this.groupLines = (res.items ?? []).map(x => ({
id: x.id,
item: String(x.item ?? ''),
linha: x.linha ?? '',
cliente: x.cliente ?? '',
usuario: x.usuario ?? '',
status: x.status ?? '',
skil: x.skil ?? '',
contrato: x.vencConta ?? ''
}));
this.loadingLines = false;
},
error: () => {
this.loadingLines = false;
this.showToast('Erro ao carregar linhas do grupo.');
}
});
}
// Carrega a Tabela Plana (Modo Tabela)
private loadFromApi() {
this.loading = true;
let params = new HttpParams()
.set('page', String(this.page))
.set('pageSize', String(this.pageSize))
.set('search', (this.searchTerm ?? '').trim())
.set('sortBy', this.mapSortKeyToApi(this.sortKey))
.set('sortDir', this.sortDir);
if (this.filterSkil === 'PF') params = params.set('skil', 'PESSOA FÍSICA');
else if (this.filterSkil === 'PJ') params = params.set('skil', 'PESSOA JURÍDICA');
else if (this.filterSkil === 'RESERVA') params = params.set('skil', 'RESERVA');
if (this.selectedClient) params = params.set('client', this.selectedClient);
this.http.get<ApiPagedResult<ApiLineList>>(this.apiBase, { params }).subscribe({
next: (res) => {
this.total = res.total ?? 0; // Total de Linhas para paginação
this.rows = (res.items ?? []).map(x => ({
id: x.id,
item: String(x.item ?? ''),
linha: x.linha ?? '',
cliente: x.cliente ?? '',
usuario: x.usuario ?? '',
status: x.status ?? '',
skil: x.skil ?? '',
contrato: x.vencConta ?? ''
}));
this.loading = false;
},
error: async () => {
this.loading = false;
await this.showToast('Erro ao carregar dados.');
}
});
}
// Troca de Abas (Todos, PF, PJ, Reserva)
setFilter(type: 'ALL' | 'PF' | 'PJ' | 'RESERVA') {
if (this.filterSkil === type) return;
this.filterSkil = type;
this.page = 1;
this.refreshData();
}
// ==========================================================
// UX & FILTROS DE CLIENTE
// ==========================================================
clearSearch() {
this.searchTerm = '';
this.page = 1;
this.refreshData();
}
private loadClients() {
this.http.get<string[]>(`${this.apiBase}/clients`).subscribe({
next: (data) => this.clientsList = data || []
});
}
toggleClientMenu() {
this.showClientMenu = !this.showClientMenu;
this.clientSearchTerm = '';
}
closeClientDropdown() {
this.showClientMenu = false;
}
selectClient(client: string | null) {
this.selectedClient = client;
this.showClientMenu = false;
this.page = 1;
this.refreshData();
}
get filteredClientsList(): string[] {
if (!this.clientSearchTerm) return this.clientsList;
const s = this.clientSearchTerm.toLowerCase();
return this.clientsList.filter(c => c.toLowerCase().includes(s));
}
// ==========================================================
// PAGINAÇÃO E ORDENAÇÃO
// ==========================================================
setSort(key: keyof LineRow) {
if (this.sortKey === key) {
this.sortDir = this.sortDir === 'asc' ? 'desc' : 'asc';
} else {
this.sortKey = key;
this.sortDir = 'asc';
}
this.page = 1;
this.loadFromApi(); // Ordenação só faz sentido visualmente na tabela
}
onPageSizeChange() {
this.page = 1;
this.refreshData();
}
goToPage(p: number) {
this.page = Math.max(1, Math.min(this.totalPages, p));
this.refreshData();
}
trackById(_: number, row: LineRow) { return row.id; }
get pagedRows() { return this.rows; } // Dados já vêm paginados do back
get totalPages() { return Math.ceil((this.total || 0) / this.pageSize) || 1; }
get filteredCount() { return this.total || 0; }
get pageStart() { return this.filteredCount === 0 ? 0 : (this.page - 1) * this.pageSize + 1; }
get pageEnd() {
return this.filteredCount === 0 ? 0 : Math.min((this.page - 1) * this.pageSize + (this.isGroupMode ? this.clientGroups.length : this.rows.length), this.filteredCount);
}
get pageNumbers() {
const total = this.totalPages;
const current = this.page;
const max = 5;
let start = Math.max(1, current - 2);
let end = Math.min(total, start + (max - 1));
start = Math.max(1, end - (max - 1));
const pages = [];
for (let i = start; i <= end; i++) pages.push(i);
return pages;
}
// ==========================================================
// IMPORTAÇÃO / AÇÕES
// ==========================================================
async onImportExcel() {
if (!this.excelInput?.nativeElement) return;
this.excelInput.nativeElement.value = '';
this.excelInput.nativeElement.click();
}
onExcelSelected(ev: Event) {
const file = (ev.target as HTMLInputElement).files?.[0];
if (!file) return;
const form = new FormData();
form.append('file', file);
this.loading = true;
this.http.post<{ imported: number }>(`${this.apiBase}/import-excel`, form).subscribe({
next: async (r) => {
await this.showToast(`Sucesso! ${r?.imported ?? 0} registros importados.`);
this.page = 1;
this.refreshData();
},
error: async () => {
this.loading = false;
await this.showToast('Falha ao importar planilha.');
}
});
}
async onCadastrarLinha() {
await this.showToast('Em breve.');
}
// ==========================================================
// MODAIS E HELPERS
// ==========================================================
private async showToast(message: string) {
if (!isPlatformBrowser(this.platformId)) return;
this.toastMessage = message;
this.cdr.detectChanges();
if (!this.successToast?.nativeElement) return;
try {
const bs = await import('bootstrap');
const toastInstance = bs.Toast.getOrCreateInstance(this.successToast.nativeElement, { autohide: true, delay: 3000 });
toastInstance.show();
} catch (error) {
console.error(error);
}
}
private getById(id: string, cb: (d: any) => void) {
this.http.get(`${this.apiBase}/${id}`).subscribe({
next: cb,
error: () => this.showToast('Erro ao carregar detalhes.')
});
}
onDetalhes(r: LineRow) {
this.detailOpen = true;
this.detailData = null;
this.getById(r.id, d => this.detailData = d);
}
onFinanceiro(r: LineRow) {
this.financeOpen = true;
this.financeData = null;
this.getById(r.id, d => this.financeData = d);
}
closeDetail() { this.detailOpen = false; this.detailData = null; }
closeFinance() { this.financeOpen = false; this.financeData = null; }
// Edição
async onEditar(r: LineRow) {
this.editOpen = true;
this.editSaving = false;
this.editModel = null;
this.editingId = r.id;
this.http.get<ApiLineDetail>(`${this.apiBase}/${r.id}`).subscribe({
next: (d) => { this.editModel = this.toEditModel(d); },
error: async () => {
this.editOpen = false;
await this.showToast('Erro ao carregar dados para edição.');
}
});
}
closeEdit() {
this.editOpen = false;
this.editSaving = false;
this.editModel = null;
this.editingId = null;
}
async saveEdit() {
if (!this.editingId || !this.editModel) return;
this.editSaving = true;
const payload: UpdateMobileLineRequest = {
item: this.toInt(this.editModel.item),
conta: (this.editModel.conta ?? '').toString(),
linha: (this.editModel.linha ?? '').toString(),
chip: (this.editModel.chip ?? '').toString(),
cliente: (this.editModel.cliente ?? '').toString(),
usuario: (this.editModel.usuario ?? '').toString(),
planoContrato: (this.editModel.planoContrato ?? '').toString(),
status: (this.editModel.status ?? '').toString(),
skil: (this.editModel.skil ?? '').toString(),
modalidade: (this.editModel.modalidade ?? '').toString(),
dataBloqueio: this.dateInputToIso(this.editModel.dataBloqueio),
cedente: (this.editModel.cedente ?? '').toString(),
solicitante: (this.editModel.solicitante ?? '').toString(),
dataEntregaOpera: this.dateInputToIso(this.editModel.dataEntregaOpera),
dataEntregaCliente: this.dateInputToIso(this.editModel.dataEntregaCliente),
vencConta: (this.editModel.vencConta ?? '').toString(),
franquiaVivo: this.toNullableNumber(this.editModel.franquiaVivo),
valorPlanoVivo: this.toNullableNumber(this.editModel.valorPlanoVivo),
gestaoVozDados: this.toNullableNumber(this.editModel.gestaoVozDados),
skeelo: this.toNullableNumber(this.editModel.skeelo),
vivoNewsPlus: this.toNullableNumber(this.editModel.vivoNewsPlus),
vivoTravelMundo: this.toNullableNumber(this.editModel.vivoTravelMundo),
vivoGestaoDispositivo: this.toNullableNumber(this.editModel.vivoGestaoDispositivo),
valorContratoVivo: this.toNullableNumber(this.editModel.valorContratoVivo),
franquiaLine: this.toNullableNumber(this.editModel.franquiaLine),
franquiaGestao: this.toNullableNumber(this.editModel.franquiaGestao),
locacaoAp: this.toNullableNumber(this.editModel.locacaoAp),
valorContratoLine: this.toNullableNumber(this.editModel.valorContratoLine),
desconto: this.toNullableNumber(this.editModel.desconto),
lucro: this.toNullableNumber(this.editModel.lucro)
};
this.http.put(`${this.apiBase}/${this.editingId}`, payload).subscribe({
next: async () => {
this.editSaving = false;
this.closeEdit();
await this.showToast('Registro atualizado!');
// Se estiver em grupo e ele estiver aberto, recarrega o grupo
if(this.isGroupMode && this.expandedGroup) {
this.toggleGroup(this.expandedGroup);
} else {
this.refreshData();
}
},
error: async (err: HttpErrorResponse) => {
this.editSaving = false;
await this.showToast('Erro ao salvar.');
}
});
}
async onRemover(r: LineRow, fromGroup = false) {
if (!confirm(`Remover linha ${r.linha}?`)) return;
this.loading = true;
this.http.delete(`${this.apiBase}/${r.id}`).subscribe({
next: async () => {
await this.showToast('Removido com sucesso.');
if(fromGroup && this.expandedGroup) {
this.toggleGroup(this.expandedGroup);
} else {
this.refreshData();
}
},
error: async () => {
this.loading = false;
await this.showToast('Erro ao remover.');
}
});
}
// Formatters
formatMoney(v: any): string { if (v == null || Number.isNaN(v)) return '-'; return new Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }).format(v); }
formatNumber(v: any): string { if (v == null || Number.isNaN(v)) return '-'; return new Intl.NumberFormat('pt-BR').format(v); }
formatFranquia(v: any): string { if (v == null || Number.isNaN(v)) return '-'; return `${new Intl.NumberFormat('pt-BR').format(v)} GB`; }
formatDateBr(iso: any): string { if (!iso) return '-'; const d = new Date(iso); return Number.isNaN(d.getTime()) ? '-' : new Intl.DateTimeFormat('pt-BR').format(d); }
statusClass(s: any): string { const n = (s??'').toLowerCase(); if(n.includes('bloq')||n.includes('perda')) return 'is-blocked'; if(n.includes('ativo')) return 'is-active'; return ''; }
statusLabel(s: any): string { return s || '-'; }
// Mappers
private mapSortKeyToApi(sortKey: keyof LineRow): string { const map: Record<string, string> = { item: 'item', linha: 'linha', cliente: 'cliente', status: 'status', skil: 'skil', contrato: 'vencConta' }; return map[String(sortKey)] ?? 'item'; }
private isoToDateInput(iso: string | null | undefined): string { if (!iso) return ''; const dt = new Date(iso); return Number.isNaN(dt.getTime()) ? '' : dt.toISOString().slice(0, 10); }
private dateInputToIso(dateStr: string | null | undefined): string | null { const s = (dateStr ?? '').trim(); return s ? new Date(`${s}T00:00:00.000Z`).toISOString() : null; }
private toNullableNumber(v: any): number | null { if (v === null || v === undefined || v === '') return null; const n = Number(String(v).trim().replace(',', '.')); return Number.isFinite(n) ? n : null; }
private toInt(v: any): number { const n = parseInt(String(v ?? '0'), 10); return Number.isFinite(n) ? n : 0; }
private toEditModel(d: ApiLineDetail) { return { ...d, dataBloqueio: this.isoToDateInput(d.dataBloqueio), dataEntregaOpera: this.isoToDateInput(d.dataEntregaOpera), dataEntregaCliente: this.isoToDateInput(d.dataEntregaCliente) }; }
}

View File

@ -1,203 +1,58 @@
<section class="home-page">
<!-- BACKGROUND GLOBAL -->
<span class="page-blob blob-1" aria-hidden="true"></span>
<span class="page-blob blob-2" aria-hidden="true"></span>
<span class="page-blob blob-3" aria-hidden="true"></span>
<span class="page-blob blob-4" aria-hidden="true"></span>
<!-- HERO -->
<section class="hero">
<div class="container">
<div class="hero-inner">
<!-- COLUNA TEXTO (CENTRALIZADA) -->
<div class="hero-copy">
<div class="hero-badge" data-animate>
<i class="bi bi-stars"></i>
SaaS para gestão de linhas corporativas
</div>
<section class="hero-text-section">
<h1 class="main-title" data-animate>
<span class="first-line">Gerencie suas linhas móveis</span>
<span class="second-line">com <strong>inteligência e praticidade</strong></span>
</h1>
<p class="main-paragraph" data-animate>
<strong class="brand-name">LineGestão</strong> é a solução completa para empresas que
<strong class="highlight">desejam controlar suas linhas móveis com eficiência e segurança</strong>.
Com recursos como <strong class="highlight">gerenciamento de clientes</strong>,
<strong class="highlight">importação de dados via Excel</strong> e
<strong class="highlight">monitoramento estratégico de contratos e linhas</strong>,
você <strong class="highlight">simplifica processos</strong>,
<strong class="highlight">reduz erros</strong> e
<strong class="highlight">ganha mais controle sobre seus recursos corporativos</strong>.
</p>
<div class="hero-actions" data-animate>
<app-cta-button
label="COMEÇAR AGORA"
(clicked)="iniciar()">
</app-cta-button>
<button type="button" class="cta-secondary" (click)="scrollToFeatures()">
<i class="bi bi-arrow-down-circle"></i>
Ver recursos
</button>
</div>
</section>
</div>
<!-- CARD/MOCK (fica na direita) -->
<div class="hero-mock" data-animate aria-label="Prévia visual do painel">
<div class="mock-card">
<div class="mock-top">
<span class="dot"></span><span class="dot"></span><span class="dot"></span>
<span class="mock-title">Visão Geral</span>
</div>
<div class="mock-grid">
<div class="mock-kpi">
<span class="kpi-label">Linhas ativas</span>
<span class="kpi-value">128</span>
<span class="kpi-tag"><i class="bi bi-graph-up"></i> controle</span>
</div>
<div class="mock-kpi">
<span class="kpi-label">Contratos</span>
<span class="kpi-value">12</span>
<span class="kpi-tag"><i class="bi bi-file-earmark-text"></i> organizado</span>
</div>
<div class="mock-kpi">
<span class="kpi-label">Clientes</span>
<span class="kpi-value">34</span>
<span class="kpi-tag"><i class="bi bi-people"></i> centralizado</span>
</div>
<div class="mock-line">
<div class="line-icon"><i class="bi bi-sim"></i></div>
<div class="line-info">
<div class="line-title">Linha 55XX9XXXXXXXX</div>
<div class="line-sub">Status: Ativa • Operadora: Vivo</div>
</div>
<div class="line-pill">OK</div>
</div>
</div>
</div>
</div>
</div>
<!-- NOVO: CENTRALIZAR OS CARDS NO MEIO -->
<div class="hero-metrics-wide" data-animate>
<div class="hero-metrics">
<div class="metric">
<i class="bi bi-lightning-charge"></i>
<div>
<span class="metric-title">Setup rápido</span>
<span class="metric-sub">comece em minutos</span>
</div>
</div>
<div class="metric">
<i class="bi bi-file-earmark-spreadsheet"></i>
<div>
<span class="metric-title">Excel → Sistema</span>
<span class="metric-sub">importação inteligente</span>
</div>
</div>
<div class="metric">
<i class="bi bi-shield-check"></i>
<div>
<span class="metric-title">Mais segurança</span>
<span class="metric-sub">menos erro manual</span>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- FEATURES -->
<section id="features" class="features-section">
<div class="container my-5">
<div class="section-head" data-animate>
<h2 class="section-title">
Tudo o que você precisa para <span class="brand">gestão de linhas</span>
</h2>
<p class="section-subtitle">
Um painel simples, bonito e direto ao ponto — feito para empresa que quer controle.
</p>
</div>
<!-- NOVO: Centralizar os cards -->
<div class="row justify-content-center feature-cards-row">
<div class="col-auto mb-4 feature-item" data-animate>
<app-feature-card
title="Monitoramento Completo"
[textAlign]="'center'"
iconClass="bi bi-laptop"
description="<strong>Acompanhe contratos, valores e suas linhas</strong> com visão estratégica, garantindo controle total sobre seus recursos móveis."
></app-feature-card>
</div>
<div class="col-auto mb-4 feature-item" data-animate>
<app-feature-card
title="Gerenciamento de Clientes"
[textAlign]="'center'"
iconClass="bi bi-people"
description="<strong>Organize e acompanhe seus clientes</strong> com praticidade e segurança, garantindo uma gestão eficiente."
></app-feature-card>
</div>
<div class="col-auto mb-4 feature-item" data-animate>
<app-feature-card
title="Importação via Excel"
[textAlign]="'center'"
iconClass="bi bi-table"
description="<strong>Integre dados rapidamente</strong> sem esforço manual, substituindo planilhas por uma solução moderna e automatizada."
></app-feature-card>
</div>
</div>
<div class="value-strip" data-animate>
<div class="value">
<i class="bi bi-check2-circle"></i>
<span><strong>Menos planilha</strong>, mais controle.</span>
</div>
<div class="value">
<i class="bi bi-check2-circle"></i>
<span><strong>Mais agilidade</strong> no dia a dia.</span>
</div>
<div class="value">
<i class="bi bi-check2-circle"></i>
<span><strong>Mais segurança</strong> na gestão.</span>
</div>
</div>
<div class="row justify-content-center button-section" data-animate>
<div class="col-auto">
<app-cta-button
label="COMEÇAR AGORA"
(clicked)="iniciar()">
</app-cta-button>
</div>
</div>
</div>
</section>
<section class="hero-text-section">
<h1 class="main-title">
<span class="first-line">Gerencie suas linhas móveis</span>
<span class="second-line">com <strong>inteligência e praticidade</strong></span>
</h1>
<p class="main-paragraph">
<strong class="brand-name">LineGestão</strong> é a solução completa para empresas que
<strong class="highlight">desejam controlar suas linhas móveis com eficiência e segurança</strong>.
Com recursos como <strong class="highlight">gerenciamento de clientes</strong>,
<strong class="highlight">importação de dados via Excel</strong> e
<strong class="highlight">monitoramento estratégico de contratos e linhas</strong>,
você <strong class="highlight">simplifica processos</strong>,
<strong class="highlight">reduz erros</strong> e
<strong class="highlight">ganha mais controle sobre seus recursos corporativos</strong>.
</p>
</section>
<div class="container my-5">
<div class="row justify-content-center feature-cards-row">
<div class="col-auto mb-4">
<app-feature-card
title="Monitoramento Completo"
[textAlign]="'center'"
iconClass="bi bi-laptop"
description="<strong>Acompanhe contratos, valores e suas linhas</strong> com visão estratégica, garantindo controle total sobre seus recursos móveis."
></app-feature-card>
</div>
<div class="col-auto mb-4">
<app-feature-card
title="Gerenciamento de Clientes"
[textAlign]="'center'"
iconClass="bi bi-people"
description="<strong>Organize e acompanhe seus clientes</strong> com praticidade e segurança, garantindo uma gestão eficiente."
></app-feature-card>
</div>
<div class="col-auto mb-4">
<app-feature-card
title="Importação via Excel"
[textAlign]="'center'"
iconClass="bi bi-table"
description="<strong>Integre dados rapidamente</strong> sem esforço manual, substituindo planilhas por uma solução moderna e automatizada."
></app-feature-card>
</div>
</div>
<div class="row justify-content-center button-section">
<div class="col-auto">
<app-cta-button label="COMEÇAR AGORA" (clicked)="iniciar()"></app-cta-button>
</div>
</div>
</div>

View File

@ -1,544 +1,136 @@
:host {
--brand: #E33DCF;
--brand-soft: rgba(227, 61, 207, 0.14);
--brand-soft-2: rgba(227, 61, 207, 0.08);
--text: #111214;
--muted: rgba(17, 18, 20, 0.70);
--radius-xl: 22px;
--radius-lg: 16px;
display: block;
}
/* ✅ FUNDO GLOBAL (vale para a Home TODA até o footer) */
.home-page {
position: relative;
min-height: 100vh;
overflow: hidden;
background:
radial-gradient(900px 420px at 20% 10%, var(--brand-soft), transparent 60%),
radial-gradient(820px 380px at 80% 30%, var(--brand-soft-2), transparent 60%),
linear-gradient(180deg, #ffffff 0%, #f5f5f7 70%);
/* névoa suave pra dar sensação de blur */
&::after {
content: '';
position: absolute;
inset: 0;
pointer-events: none;
background: rgba(255, 255, 255, 0.25);
}
}
/* ✅ BLOBS FIXOS (continuam no scroll) */
.page-blob {
position: fixed;
pointer-events: none;
border-radius: 999px;
filter: blur(34px);
opacity: 0.55;
z-index: 0;
background: radial-gradient(circle at 30% 30%, rgba(227,61,207,0.55), rgba(227,61,207,0.06));
animation: floaty 10s ease-in-out infinite;
&.blob-1 { width: 420px; height: 420px; top: -140px; left: -140px; }
&.blob-2 { width: 520px; height: 520px; top: -220px; right: -240px; animation-duration: 12s; }
&.blob-3 { width: 360px; height: 360px; bottom: -180px; left: 25%; animation-duration: 14s; }
&.blob-4 { width: 520px; height: 520px; bottom: -260px; right: -260px; animation-duration: 16s; opacity: .45; }
@media (max-width: 992px) {
opacity: 0.35;
}
}
/* ✅ garante que o conteúdo fique acima do fundo */
.hero,
.features-section,
.container {
position: relative;
z-index: 1;
}
/* =============================== */
/* HERO */
/* CONTAINER PRINCIPAL */
/* =============================== */
.hero {
padding: 56px 0 18px 0;
}
.hero-inner {
display: grid;
grid-template-columns: 1.1fr 0.9fr;
gap: 36px;
align-items: center;
@media (max-width: 992px) {
grid-template-columns: 1fr;
gap: 26px;
}
}
/* texto centralizado */
.hero-copy {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
/* badge */
.hero-badge {
display: inline-flex;
align-items: center;
gap: 10px;
width: fit-content;
padding: 10px 14px;
border-radius: 999px;
background: rgba(255, 255, 255, 0.78);
border: 1px solid rgba(227, 61, 207, 0.22);
backdrop-filter: blur(10px);
color: var(--text);
font-family: 'Inter', sans-serif;
font-size: 14px;
font-weight: 700;
i { color: var(--brand); font-size: 16px; }
}
.hero-text-section {
width: 100%;
margin-top: 12px;
text-align: center;
padding-top: 50px;
margin: 0 auto;
}
/* título */
/* =============================== */
/* TÍTULO PRINCIPAL */
/* =============================== */
.main-title {
font-family: 'Inter', sans-serif;
font-size: 52px;
line-height: 1.05;
margin: 18px 0 18px 0;
font-size: 48px;
line-height: 1.2;
margin-bottom: 30px;
display: flex;
flex-direction: column;
align-items: center;
@media (max-width: 1400px) { font-size: 44px; }
@media (max-width: 1024px) { font-size: 38px; }
@media (max-width: 768px) { font-size: 32px; }
@media (max-width: 480px) { font-size: 28px; }
width: fit-content;
margin: 0 auto 80px auto;
/* ========== RESPONSIVO ========== */
/* até 1400px diminui um pouco */
@media (max-width: 1400px) {
font-size: 40px;
}
/* tablets e notebooks pequenos */
@media (max-width: 1024px) {
font-size: 36px;
}
/* tablets menores */
@media (max-width: 768px) {
font-size: 32px;
margin-bottom: 50px;
}
/* celulares */
@media (max-width: 480px) {
font-size: 28px;
margin-bottom: 40px;
}
}
.main-title .first-line,
.main-title .second-line {
font-weight: 650;
/* Primeira linha */
.main-title .first-line {
color: #E33DCF;
font-weight: 500;
display: block;
color: var(--text);
text-align: center;
}
.main-title strong {
color: var(--brand);
position: relative;
/* Segunda linha */
.main-title .second-line {
color: #E33DCF;
font-weight: 500;
display: block;
text-align: center;
}
.main-title strong::after {
content: '';
position: absolute;
left: 0;
bottom: 6px;
width: 100%;
height: 10px;
border-radius: 999px;
background: rgba(227, 61, 207, 0.18);
z-index: -1;
/* -------- Efeito deslocado só em telas grandes -------- */
@media (min-width: 1200px) {
.main-title .first-line {
transform: translateX(-70px);
}
.main-title .second-line {
transform: translateX(100px) translateY(-6px);
}
}
/* parágrafo */
/* Em telas menores que 1200px o título fica plenamente centralizado */
@media (max-width: 1199.98px) {
.main-title .first-line,
.main-title .second-line {
transform: none; /* garante que não herda nenhum translate */
}
}
/* =============================== */
/* PARÁGRAFO PRINCIPAL */
/* =============================== */
.main-paragraph {
width: min(980px, 100%);
margin: 0 auto 16px auto;
width: 985px;
height: 132px;
margin: 0 auto 50px auto;
font-family: 'Poppins', sans-serif;
font-size: 20px;
color: var(--muted);
line-height: 1.45;
@media (max-width: 1400px) { font-size: 19px; }
@media (max-width: 1024px) { font-size: 18px; }
@media (max-width: 768px) { font-size: 16px; }
}
.main-paragraph .brand-name { color: var(--text); }
.main-paragraph .highlight { color: var(--text); font-weight: 800; }
.main-paragraph strong { font-weight: 800; }
/* botões */
.hero-actions {
display: flex;
gap: 14px;
align-items: center;
justify-content: center;
margin-top: 16px;
flex-wrap: wrap;
}
.cta-secondary {
height: 44px;
padding: 0 14px;
border-radius: 12px;
background: rgba(255, 255, 255, 0.72);
border: 1px solid rgba(17, 18, 20, 0.10);
color: var(--text);
font-weight: 800;
display: inline-flex;
align-items: center;
gap: 10px;
transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
i { color: var(--brand); }
&:hover {
transform: translateY(-2px);
border-color: rgba(227, 61, 207, 0.28);
box-shadow: 0 12px 24px rgba(17, 18, 20, 0.10);
}
}
/* =============================== */
/* MOCK (direita) */
/* =============================== */
.hero-mock {
display: flex;
justify-content: flex-end;
@media (max-width: 992px) {
justify-content: center;
}
}
.mock-card {
width: min(460px, 100%);
border-radius: var(--radius-xl);
background: rgba(255, 255, 255, 0.78);
border: 1px solid rgba(227, 61, 207, 0.14);
backdrop-filter: blur(12px);
box-shadow: 0 22px 46px rgba(17, 18, 20, 0.10);
overflow: hidden;
transform: perspective(900px) rotateY(-6deg) rotateX(2deg);
transition: transform 200ms ease;
&:hover {
transform: perspective(900px) rotateY(-2deg) rotateX(1deg) translateY(-2px);
}
}
.mock-top {
display: flex;
align-items: center;
gap: 8px;
padding: 14px 16px;
background: linear-gradient(180deg, rgba(227, 61, 207, 0.10), rgba(255, 255, 255, 0.20));
.dot {
width: 10px;
height: 10px;
border-radius: 999px;
background: rgba(17, 18, 20, 0.12);
}
.mock-title {
margin-left: 6px;
font-weight: 950;
font-family: 'Inter', sans-serif;
color: var(--text);
}
}
.mock-grid {
padding: 16px;
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
@media (max-width: 380px) { grid-template-columns: 1fr; }
}
.mock-kpi {
border-radius: var(--radius-lg);
background: #fff;
border: 1px solid rgba(17, 18, 20, 0.08);
padding: 12px;
.kpi-label {
display: block;
font-size: 12px;
color: rgba(17, 18, 20, 0.65);
font-family: 'Inter', sans-serif;
font-weight: 800;
}
.kpi-value {
display: block;
font-size: 26px;
font-family: 'Inter', sans-serif;
font-weight: 950;
color: var(--text);
margin-top: 2px;
}
.kpi-tag {
display: inline-flex;
align-items: center;
gap: 6px;
margin-top: 8px;
padding: 6px 10px;
border-radius: 999px;
border: 1px solid rgba(227, 61, 207, 0.20);
background: rgba(227, 61, 207, 0.07);
color: var(--text);
font-size: 12px;
font-weight: 900;
i { color: var(--brand); }
}
}
.mock-line {
grid-column: 1 / -1;
border-radius: var(--radius-lg);
background: #fff;
border: 1px solid rgba(17, 18, 20, 0.08);
padding: 12px;
display: grid;
grid-template-columns: auto 1fr auto;
gap: 12px;
align-items: center;
.line-icon {
width: 40px;
height: 40px;
border-radius: 12px;
background: rgba(227, 61, 207, 0.10);
display: grid;
place-items: center;
i { color: var(--brand); font-size: 18px; }
}
.line-title {
font-weight: 950;
font-family: 'Inter', sans-serif;
color: var(--text);
font-size: 14px;
}
.line-sub {
color: rgba(17, 18, 20, 0.65);
font-size: 12px;
margin-top: 2px;
font-family: 'Inter', sans-serif;
}
.line-pill {
padding: 8px 10px;
border-radius: 999px;
font-weight: 950;
font-size: 12px;
background: rgba(227, 61, 207, 0.10);
border: 1px solid rgba(227, 61, 207, 0.22);
color: var(--text);
}
}
/* =============================== */
/* MÉTRICAS CENTRALIZADAS (MEIO) */
/* =============================== */
.hero-metrics-wide {
margin-top: 18px;
display: flex;
justify-content: center;
}
.hero-metrics {
display: flex;
gap: 14px;
flex-wrap: wrap;
justify-content: center;
}
.metric {
display: inline-flex;
align-items: center;
gap: 10px;
padding: 12px 14px;
border-radius: 14px;
background: rgba(255, 255, 255, 0.78);
border: 1px solid rgba(227, 61, 207, 0.16);
backdrop-filter: blur(10px);
i { color: var(--brand); font-size: 18px; }
.metric-title {
display: block;
font-weight: 900;
color: var(--text);
font-family: 'Inter', sans-serif;
font-size: 14px;
line-height: 1.1;
}
.metric-sub {
display: block;
font-family: 'Inter', sans-serif;
font-size: 12px;
color: rgba(17, 18, 20, 0.65);
}
}
/* =============================== */
/* FEATURES */
/* =============================== */
.features-section {
padding: 18px 0 60px 0;
background: transparent;
}
.section-head {
font-size: 24px;
color: #000000;
line-height: 1;
font-weight: 400;
text-align: center;
margin-bottom: 24px;
}
.section-title {
font-family: 'Inter', sans-serif;
font-weight: 950;
color: var(--text);
font-size: 30px;
/* ========== RESPONSIVO ========== */
@media (max-width: 768px) { font-size: 24px; }
}
.section-title .brand { color: var(--brand); }
.section-subtitle {
margin-top: 10px;
color: var(--muted);
font-family: 'Poppins', sans-serif;
}
/* ✅ AQUI: 3 CARDS CENTRALIZADOS LADO A LADO NO NOTEBOOK */
.feature-cards-row {
display: flex;
justify-content: center;
align-items: stretch;
gap: 26px;
flex-wrap: nowrap; /* ✅ força ficar em 1 linha */
/* notebook / telas médias */
@media (max-width: 1199.98px) {
gap: 18px;
@media (max-width: 1400px) {
width: 65%;
height: auto;
font-size: 20px;
}
/* quando a tela ficar pequena de verdade, aí quebra */
@media (max-width: 992px) {
flex-wrap: wrap;
/* Tablets */
@media (max-width: 1024px) {
width: 70%;
height: auto;
font-size: 20px;
line-height: 1.2;
}
/* Tablets pequenos */
@media (max-width: 768px) {
width: 80%;
font-size: 18px;
line-height: 1.25;
margin-bottom: 40px;
}
/* Celulares */
@media (max-width: 480px) {
width: 90%;
font-size: 16px;
line-height: 1.3;
margin-bottom: 30px;
}
}
/* Garante que o col-auto do bootstrap não atrapalhe */
.feature-item {
display: flex;
justify-content: center;
align-items: stretch;
margin-bottom: 0 !important;
}
/* melhora o respiro no botão */
.button-section {
margin-top: 18px;
}
/* faixa de valores */
.value-strip {
margin-top: 50px;
padding: 14px 16px;
border-radius: var(--radius-xl);
background: rgba(255, 255, 255, 0.80);
border: 1px solid rgba(227, 61, 207, 0.14);
backdrop-filter: blur(10px);
display: flex;
justify-content: center;
gap: 18px;
flex-wrap: wrap;
.value {
display: inline-flex;
align-items: center;
gap: 10px;
i { color: var(--brand); font-size: 18px; }
span { color: var(--text); font-family: 'Inter', sans-serif; }
}
}
/* =============================== */
/* ✅ ANIMAÇÕES SSR-SAFE */
/* =============================== */
[data-animate] { opacity: 1; transform: none; }
.js-animate [data-animate] {
opacity: 0;
transform: translateY(14px);
transition: opacity 600ms ease, transform 600ms ease;
will-change: opacity, transform;
}
.js-animate [data-animate].is-visible {
opacity: 1;
transform: translateY(0);
}
/* brilho suave no botão */
:host ::ng-deep app-cta-button .btn,
:host ::ng-deep app-cta-button button {
position: relative;
overflow: hidden;
transform: translateZ(0);
}
:host ::ng-deep app-cta-button .btn::after,
:host ::ng-deep app-cta-button button::after {
content: '';
position: absolute;
inset: 0;
transform: translateX(-120%) rotate(12deg);
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
animation: shine 3.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
.page-blob { animation: none; }
.js-animate [data-animate] { transition: none; transform: none; opacity: 1; }
:host ::ng-deep app-cta-button .btn::after,
:host ::ng-deep app-cta-button button::after { animation: none; }
}
@keyframes floaty {
0% { transform: translate(0, 0) scale(1); }
50% { transform: translate(18px, 10px) scale(1.03); }
100% { transform: translate(0, 0) scale(1); }
}
@keyframes shine {
0%, 65% { transform: translateX(-120%) rotate(12deg); opacity: 0.0; }
75% { opacity: 1; }
100% { transform: translateX(120%) rotate(12deg); opacity: 0.0; }
.main-paragraph strong {
font-weight: 700;
}

View File

@ -1,68 +1,34 @@
import { Component, AfterViewInit, Inject, PLATFORM_ID } from '@angular/core';
import { CommonModule, isPlatformBrowser } from '@angular/common';
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common'; // Importa CommonModule
import { FeatureCardComponent } from '../../components/feature-card/feature-card';
import { CtaButtonComponent } from '../../components/cta-button/cta-button';
import { Router } from '@angular/router';
@Component({
selector: 'app-home',
standalone: true,
imports: [CommonModule, FeatureCardComponent, CtaButtonComponent],
// 1. Marca o componente como autônomo
standalone: true,
// 2. Importa o que o template precisa:
imports: [
CommonModule, // Para usar diretivas comuns (ngClass, ngIf, etc.) no seu home.html
FeatureCardComponent, // Para usar o seletor <app-feature-card> no seu home.html
CtaButtonComponent
],
templateUrl: './home.html',
styleUrls: ['./home.scss'],
styleUrl: './home.scss',
})
export class Home implements AfterViewInit {
private readonly isBrowser: boolean;
constructor(
private router: Router,
@Inject(PLATFORM_ID) platformId: Object
) {
this.isBrowser = isPlatformBrowser(platformId);
}
export class Home {
// Seus dados dos cards podem ser definidos aqui para uso no home.html:
/*
cardsData = [
{ title: 'Monitoramento Completo', iconClass: 'bi bi-laptop', description: '...' },
// ...
];
*/
iniciar(): void {
this.router.navigate(['/register']);
console.log('Botão COMEÇAR AGORA clicado! Redirecionando ou abrindo modal...');
// Aqui você adicionaria sua lógica de navegação, como:
// this.router.navigate(['/cadastro']);
// Ou uma chamada para abrir um modal de registro.
}
scrollToFeatures(): void {
if (!this.isBrowser) return;
document.getElementById('features')?.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
ngAfterViewInit(): void {
if (!this.isBrowser) return;
document.documentElement.classList.add('js-animate');
setTimeout(() => {
const items = Array.from(document.querySelectorAll<HTMLElement>('[data-animate]'));
if (!items.length) return;
const reduceMotion =
window.matchMedia &&
window.matchMedia('(prefers-reduced-motion: reduce)').matches;
if (reduceMotion) {
items.forEach(i => i.classList.add('is-visible'));
return;
}
if (!('IntersectionObserver' in window)) {
items.forEach(i => i.classList.add('is-visible'));
return;
}
const io = new IntersectionObserver((entries) => {
for (const entry of entries) {
if (entry.isIntersecting) {
(entry.target as HTMLElement).classList.add('is-visible');
io.unobserve(entry.target);
}
}
}, { threshold: 0.12 });
items.forEach(el => io.observe(el));
}, 0);
}
}
}

View File

@ -1,73 +0,0 @@
<div class="login-wrapper">
<div class="login-card shadow-sm">
<!-- Título -->
<div class="login-title mb-4">
<h2 class="mb-0">Login</h2>
</div>
<form [formGroup]="loginForm" (ngSubmit)="onSubmit()">
<!-- Usuário -->
<div class="mb-3">
<label class="form-label">Usuário</label>
<input
type="text"
class="form-control"
formControlName="username"
placeholder="Usuário" />
<div class="text-danger small mt-1" *ngIf="hasError('username')">
Informe o usuário.
</div>
</div>
<!-- Senha -->
<div class="mb-4">
<label class="form-label">Senha</label>
<input
type="password"
class="form-control"
formControlName="password"
placeholder="Senha" />
<div class="text-danger small mt-1" *ngIf="hasError('password')">
A senha deve ter pelo menos 6 caracteres.
</div>
</div>
<!-- Erro da API -->
<div *ngIf="apiError" class="alert alert-danger py-2 mb-3">
{{ apiError }}
</div>
<!-- Botão Entrar -->
<button
type="submit"
class="btn btn-primary w-100 login-btn-submit"
[disabled]="isSubmitting">
{{ isSubmitting ? 'Entrando...' : 'ENTRAR' }}
</button>
</form>
</div>
</div>
<!-- Toast (Sucesso Login) -->
<div class="toast-container position-fixed top-0 end-0 p-3" style="z-index: 2000;">
<div
#successToast
class="toast text-bg-success"
role="alert"
aria-live="assertive"
aria-atomic="true"
>
<div class="toast-header">
<strong class="me-auto">LineGestão</strong>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Fechar"></button>
</div>
<div class="toast-body">
{{ toastMessage }}
</div>
</div>
</div>

View File

@ -1,216 +0,0 @@
/* ========================= */
/* TELA DE LOGIN */
/* ========================= */
/* Wrapper para centralizar o card entre header e footer */
.login-wrapper {
min-height: calc(100vh - 69.2px);
display: flex;
justify-content: center; /* login fica no centro */
align-items: center;
padding-top: 32px;
padding-right: 12px;
padding-bottom: 100px; /* mesmo “respiro” do cadastro */
padding-left: 12px;
background-color: #efefef;
/* IMAGEM DESKTOP (PADRÃO) */
background-image: url('../../../assets/wallpaper/registro_login.png');
background-repeat: no-repeat;
background-position: right top;
background-size: cover;
/* 🔑 fundo preso ao viewport (igual cadastro) */
background-attachment: fixed;
}
/* NOTEBOOKS / TABLETS */
@media (max-width: 992px) {
.login-wrapper {
padding-top: 24px;
padding-left: 16px;
padding-right: 16px;
padding-bottom: 60px;
background-position: center top;
background-size: cover;
background-attachment: scroll;
}
}
/* CELULARES IMAGEM MOBILE */
@media (max-width: 576px) {
.login-wrapper {
min-height: calc(100vh - 40px);
padding-top: 20px;
padding-bottom: 32px;
padding-left: 16px;
padding-right: 16px;
background-image: url('../../../assets/wallpaper/mobile.png');
background-repeat: no-repeat;
background-position: center top;
background-size: cover;
background-attachment: scroll;
}
}
/* ========================= */
/* CARD DE LOGIN */
/* ========================= */
/* Desktop grande (monitor) */
.login-card {
background-color: transparent;
border-radius: 10px;
border: 2px solid #c91eb5;
max-width: 480px; /* antes 500px */
width: 100%;
min-height: 360px; /* antes 380px */
padding: 26px 22px; /* antes 28px 24px */
box-sizing: border-box;
backdrop-filter: blur(6px);
-webkit-backdrop-filter: blur(6px);
.mb-3,
.mb-4 {
margin-bottom: 0.8rem; /* antes 0.9rem */
}
}
/* NOTEB00KS (≤1440px) deixa ainda mais compacto */
@media (max-width: 1440px) {
.login-card {
max-width: 430px;
min-height: 330px;
padding: 22px 20px;
}
.login-title h2 {
font-size: 30px; /* levemente menor */
}
}
/* notebooks / tablets (≤992px) */
@media (max-width: 992px) {
.login-card {
max-width: 400px;
min-height: 310px;
padding: 20px 18px;
}
.login-title h2 {
font-size: 26px;
}
.form-control {
height: 36px;
font-size: 13px;
}
.login-btn-submit {
font-size: 13px;
padding: 7px 0;
}
.mb-3,
.mb-4 {
margin-bottom: 0.7rem;
}
}
/* celulares (≤576px) bem enxuto */
@media (max-width: 576px) {
.login-card {
max-width: 340px;
min-height: auto;
padding: 18px 14px;
}
.login-title h2 {
font-size: 24px;
}
.form-control {
height: 34px;
font-size: 13px;
}
.login-btn-submit {
font-size: 12.5px;
padding: 7px 0;
}
}
/* ========================= */
/* TIPOGRAFIA E FORM */
/* ========================= */
/* Título centralizado rosa */
.login-title {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 1.25rem !important;
h2 {
font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
font-weight: 700;
font-size: 32px;
color: #c91eb5;
margin: 0;
}
}
/* Labels mesmo tamanho do cadastro */
.form-label {
font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
font-weight: 500;
font-size: 14px;
color: #000000;
}
/* Inputs iguais aos do cadastro (borda azul) */
.form-control {
height: 38px;
border-radius: 8px;
border: 2px solid #6066ff;
font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
font-weight: 500;
font-size: 14px;
color: #000000;
&::placeholder {
color: rgba(0, 0, 0, 0.5);
}
}
/* Botão ENTRAR rosa sólido, mesmo estilo do cadastrar */
.login-btn-submit {
border-radius: 40px;
border: none;
font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
font-weight: 600;
font-size: 14px;
letter-spacing: 0.5px;
text-transform: uppercase;
padding: 9px 0;
background-color: #c91eb5;
color: #ffffff;
&:hover {
filter: brightness(1.04);
}
}
/* Mensagens de erro */
.text-danger.small {
font-size: 11px;
}

View File

@ -1,121 +0,0 @@
import { Component, ElementRef, ViewChild, Inject, PLATFORM_ID } from '@angular/core';
import { CommonModule, isPlatformBrowser } from '@angular/common';
import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
import { Router } from '@angular/router';
import { AuthService } from '../../services/auth.service';
@Component({
selector: 'app-login',
standalone: true,
imports: [CommonModule, ReactiveFormsModule],
templateUrl: './login.html',
styleUrls: ['./login.scss']
})
export class LoginComponent {
loginForm: FormGroup;
isSubmitting = false;
apiError = '';
toastMessage = '';
@ViewChild('successToast') successToast!: ElementRef;
constructor(
private fb: FormBuilder,
private authService: AuthService,
private router: Router,
@Inject(PLATFORM_ID) private platformId: object
) {
this.loginForm = this.fb.group({
username: ['', [Validators.required]], // aqui é email
password: ['', [Validators.required, Validators.minLength(6)]]
});
}
private async showToast(message: string) {
this.toastMessage = message;
// ✅ SSR-safe: só roda no browser
if (!isPlatformBrowser(this.platformId)) return;
const bs = await import('bootstrap');
const toast = new bs.Toast(this.successToast.nativeElement, { autohide: true, delay: 1500 });
toast.show();
}
private getNameFromToken(token: string): string {
try {
const payload = token.split('.')[1];
const base64 = payload.replace(/-/g, '+').replace(/_/g, '/');
const json = decodeURIComponent(
atob(base64)
.split('')
.map(c => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2))
.join('')
);
const data = JSON.parse(json);
return data?.name ?? 'usuário';
} catch {
return 'usuário';
}
}
private saveToken(token: string) {
// ✅ SSR-safe
if (!isPlatformBrowser(this.platformId)) return;
// evita token antigo conflitar
localStorage.removeItem('token');
localStorage.setItem('token', token);
}
onSubmit(): void {
this.apiError = '';
if (this.loginForm.invalid) {
this.loginForm.markAllAsTouched();
return;
}
this.isSubmitting = true;
const v = this.loginForm.value;
const payload = {
email: v.username,
password: v.password
};
this.authService.login(payload).subscribe({
next: async (res) => {
this.isSubmitting = false;
const token = res?.token;
if (!token) {
this.apiError = 'Login retornou sem token. Verifique a resposta da API.';
return;
}
// ✅ salva token para o Interceptor anexar nas próximas requisições
this.saveToken(token);
const nome = this.getNameFromToken(token);
// ✅ Vai para /geral já levando a mensagem do toast
this.router.navigate(['/geral'], {
state: { toastMessage: `Bem-vindo, ${nome}!` }
});
},
error: (err) => {
this.isSubmitting = false;
this.apiError = err?.error ?? 'Erro ao fazer login.';
}
});
}
hasError(field: string, error?: string): boolean {
const control = this.loginForm.get(field);
if (!control) return false;
if (error) return control.touched && control.hasError(error);
return control.touched && control.invalid;
}
}

View File

@ -1,131 +1 @@
<!-- src/app/pages/register.component.html -->
<div class="register-wrapper">
<div class="register-card shadow-sm">
<!-- Barra / título -->
<div class="register-title mb-4">
<span class="register-icon">
<i class="bi bi-box-arrow-in-right"></i>
</span>
<h2 class="mb-0">Cadastre-se</h2>
</div>
<form [formGroup]="registerForm" (ngSubmit)="onSubmit()">
<!-- Nome completo -->
<div class="mb-3">
<label class="form-label">Nome Completo</label>
<input
type="text"
class="form-control"
formControlName="fullName"
placeholder="Nome Completo" />
<div class="text-danger small mt-1" *ngIf="hasError('fullName')">
Informe o seu nome completo (mínimo 3 caracteres).
</div>
</div>
<!-- E-mail -->
<div class="mb-3">
<label class="form-label">E-mail</label>
<input
type="email"
class="form-control"
formControlName="email"
placeholder="E-mail" />
<div class="text-danger small mt-1" *ngIf="hasError('email', 'required')">
E-mail é obrigatório.
</div>
<div class="text-danger small mt-1" *ngIf="hasError('email', 'email')">
Informe um e-mail válido.
</div>
</div>
<!-- Telefone -->
<div class="mb-3">
<label class="form-label">Telefone</label>
<input
type="tel"
class="form-control"
formControlName="phone"
placeholder="Telefone" />
<div class="text-danger small mt-1" *ngIf="hasError('phone')">
Informe um telefone válido.
</div>
</div>
<!-- Senha -->
<div class="mb-3">
<label class="form-label">Senha</label>
<input
type="password"
class="form-control"
formControlName="password"
placeholder="Senha" />
<div class="text-danger small mt-1" *ngIf="hasError('password')">
A senha deve ter pelo menos 6 caracteres.
</div>
</div>
<!-- Confirmar senha -->
<div class="mb-4">
<label class="form-label">Confirme sua senha</label>
<input
type="password"
class="form-control"
formControlName="confirmPassword"
placeholder="Confirme sua senha" />
<div class="text-danger small mt-1" *ngIf="registerForm.errors?.['passwordsMismatch'] && registerForm.touched">
As senhas não conferem.
</div>
</div>
<!-- Erro da API -->
<div *ngIf="apiError" class="alert alert-danger py-2 mb-3">
{{ apiError }}
</div>
<!-- Botão Cadastrar -->
<button
type="submit"
class="btn btn-primary w-100 register-btn mb-3"
[disabled]="isSubmitting">
{{ isSubmitting ? 'Cadastrando...' : 'CADASTRAR' }}
</button>
<!-- Botão para quem já tem conta -->
<button
type="button"
class="btn btn-outline-primary w-100 login-btn"
routerLink="/login">
JÁ TEM UMA CONTA? ENTRE
</button>
</form>
</div>
</div>
<!-- Toast (Sucesso Cadastro) -->
<div class="toast-container position-fixed top-0 end-0 p-3" style="z-index: 2000;">
<div
#successToast
class="toast text-bg-success"
role="alert"
aria-live="assertive"
aria-atomic="true"
>
<div class="toast-header">
<strong class="me-auto">LineGestão</strong>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Fechar"></button>
</div>
<div class="toast-body">
{{ toastMessage }}
</div>
</div>
</div>
<p>register works!</p>

View File

@ -1,254 +0,0 @@
/* ========================= */
/* TELA DE CADASTRO */
/* ========================= */
/* Wrapper para centralizar o card entre header e footer */
.register-wrapper {
/* mesma altura base do login */
min-height: calc(100vh - 69.2px);
display: flex;
justify-content: center; /* igual ao login */
align-items: center;
/* mesmos paddings do login */
padding-top: 32px;
padding-right: 12px;
padding-bottom: 100px;
padding-left: 12px;
background-color: #efefef;
/* mesma imagem/config do login */
background-image: url('../../../assets/wallpaper/registro_login.png');
background-repeat: no-repeat;
background-position: right top;
background-size: cover;
/* 🔑 fundo preso ao viewport → não “dá zoom” por causa da altura maior */
background-attachment: fixed;
}
/* NOTEBOOKS / TABLETS */
@media (max-width: 992px) {
.register-wrapper {
justify-content: center;
padding-top: 24px;
padding-left: 16px;
padding-right: 16px;
padding-bottom: 60px;
background-position: center top;
background-size: cover;
background-attachment: scroll; /* evita bug em telas menores */
}
}
/* CELULARES IMAGEM MOBILE */
@media (max-width: 576px) {
.register-wrapper {
min-height: calc(100vh - 40px);
padding-top: 20px;
padding-bottom: 32px;
padding-left: 16px;
padding-right: 16px;
background-image: url('../../../assets/wallpaper/mobile.png');
background-repeat: no-repeat;
background-position: center top;
background-size: cover;
background-attachment: scroll;
}
}
/* ========================= */
/* CARD DE CADASTRO (MENOR) */
/* ========================= */
/* Desktop grande (monitor) */
.register-card {
background-color: transparent;
border-radius: 10px;
border: 2px solid #c91eb5;
/* ➜ menor que antes */
max-width: 460px;
width: 100%;
min-height: 430px;
padding: 22px 20px;
box-sizing: border-box;
margin-left: 0;
backdrop-filter: blur(6px);
-webkit-backdrop-filter: blur(6px);
.mb-3,
.mb-4 {
margin-bottom: 0.8rem; /* menos espaço entre os blocos */
}
}
/* NOTEBOOKS (≤1440px) ainda mais compacto */
@media (max-width: 1440px) {
.register-card {
max-width: 420px;
min-height: 400px;
padding: 20px 18px;
}
.register-title h2 {
font-size: 30px;
}
}
/* notebooks / tablets (≤992px) */
@media (max-width: 992px) {
.register-card {
max-width: 380px;
min-height: 360px;
padding: 18px 16px;
}
.register-title h2 {
font-size: 26px;
}
.form-control {
height: 36px;
font-size: 13px;
}
.register-btn,
.login-btn {
font-size: 13px;
padding: 7px 0;
}
.mb-3,
.mb-4 {
margin-bottom: 0.7rem;
}
}
/* celulares (≤576px) compacto, mas confortável */
@media (max-width: 576px) {
.register-card {
max-width: 330px;
min-height: auto;
padding: 18px 14px;
}
.register-title h2 {
font-size: 24px;
}
.form-control {
height: 34px;
font-size: 13px;
}
.register-btn,
.login-btn {
font-size: 12.5px;
padding: 7px 0;
}
}
/* ========================= */
/* TÍTULO + ÍCONE */
/* ========================= */
.register-title {
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
margin-bottom: 1.25rem !important;
h2 {
font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
font-weight: 700;
font-size: 32px;
color: #c91eb5;
margin: 0;
}
}
.register-icon {
display: flex;
align-items: center;
justify-content: center;
color: #c91eb5;
i {
font-size: 35px;
}
}
/* ========================= */
/* FORM / INPUTS / BOTÕES */
/* ========================= */
.form-label {
font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
font-weight: 500;
font-size: 14px;
color: #000000;
}
.form-control {
height: 38px;
border-radius: 8px;
border: 2px solid #6066ff;
font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
font-weight: 500;
font-size: 14px;
color: #000000;
&::placeholder {
color: rgba(0, 0, 0, 0.5);
}
}
.register-btn {
border-radius: 40px;
border: none;
font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
font-weight: 600;
font-size: 14px;
letter-spacing: 0.5px;
text-transform: uppercase;
padding: 9px 0;
background-color: #c91eb5;
color: #ffffff;
&:hover {
filter: brightness(1.04);
}
}
.login-btn {
border-radius: 40px;
border: none;
font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
font-weight: 600;
font-size: 13px;
letter-spacing: 0.5px;
text-transform: uppercase;
padding: 8px 0;
background-color: #030faa;
color: #ffffff;
&:hover {
filter: brightness(1.04);
}
}
.text-danger.small {
font-size: 11px;
}

View File

@ -1,102 +1,11 @@
import { Component, ElementRef, ViewChild, Inject, PLATFORM_ID } from '@angular/core';
import { CommonModule, isPlatformBrowser } from '@angular/common';
import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
import { Router, RouterLink } from '@angular/router';
import { AuthService } from '../../services/auth.service';
import { Component } from '@angular/core';
@Component({
selector: 'app-register',
standalone: true,
imports: [CommonModule, ReactiveFormsModule, RouterLink],
imports: [],
templateUrl: './register.html',
styleUrls: ['./register.scss']
styleUrl: './register.scss',
})
export class Register {
registerForm: FormGroup;
isSubmitting = false;
apiError = '';
toastMessage = '';
@ViewChild('successToast') successToast!: ElementRef;
constructor(
private fb: FormBuilder,
private authService: AuthService,
private router: Router,
@Inject(PLATFORM_ID) private platformId: object
) {
this.registerForm = this.fb.group({
fullName: ['', [Validators.required, Validators.minLength(3)]],
email: ['', [Validators.required, Validators.email]],
phone: ['', [Validators.required]],
password: ['', [Validators.required, Validators.minLength(6)]],
confirmPassword: ['', [Validators.required]]
}, {
validators: [this.passwordsMatchValidator]
});
}
private passwordsMatchValidator(group: FormGroup) {
const pass = group.get('password')?.value;
const confirm = group.get('confirmPassword')?.value;
return pass === confirm ? null : { passwordsMismatch: true };
}
private async showToast(message: string) {
this.toastMessage = message;
// ✅ SSR-safe: só roda no browser
if (!isPlatformBrowser(this.platformId)) return;
const bs = await import('bootstrap');
const toast = new bs.Toast(this.successToast.nativeElement, { autohide: true, delay: 1800 });
toast.show();
}
onSubmit(): void {
this.apiError = '';
if (this.registerForm.invalid) {
this.registerForm.markAllAsTouched();
return;
}
this.isSubmitting = true;
const v = this.registerForm.value;
const payload = {
name: v.fullName,
email: v.email,
phone: v.phone,
password: v.password,
confirmPassword: v.confirmPassword
};
this.authService.register(payload).subscribe({
next: async () => {
this.isSubmitting = false;
// Se você não quer manter "logado" após cadastrar:
localStorage.removeItem('token');
await this.showToast('Cadastro realizado com sucesso! Agora faça login para continuar.');
setTimeout(() => {
this.router.navigate(['/login']);
}, 1000);
},
error: (err) => {
this.isSubmitting = false;
this.apiError = err?.error ?? 'Erro ao cadastrar.';
}
});
}
hasError(field: string, error?: string): boolean {
const control = this.registerForm.get(field);
if (!control) return false;
if (error) return control.touched && control.hasError(error);
return control.touched && control.invalid;
}
}

View File

@ -1,46 +0,0 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { environment } from '../../environments/environment';
import { tap } from 'rxjs/operators';
export interface RegisterPayload {
name: string;
email: string;
phone: string;
password: string;
confirmPassword: string;
}
export interface LoginPayload {
email: string;
password: string;
}
@Injectable({ providedIn: 'root' })
export class AuthService {
private baseUrl = `${environment.apiUrl}/auth`;
constructor(private http: HttpClient) {}
register(payload: RegisterPayload) {
return this.http.post<{ token: string }>(`${this.baseUrl}/register`, payload)
.pipe(tap(r => localStorage.setItem('token', r.token)));
}
login(payload: LoginPayload) {
return this.http.post<{ token: string }>(`${this.baseUrl}/login`, payload)
.pipe(tap(r => localStorage.setItem('token', r.token)));
}
logout() {
localStorage.removeItem('token');
}
get token(): string | null {
return localStorage.getItem('token');
}
isLoggedIn(): boolean {
return !!this.token;
}
}

View File

@ -1,86 +0,0 @@
import { HttpClient, HttpParams } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
export interface PagedResult<T> {
page: number;
pageSize: number;
total: number;
items: T[];
}
export interface MobileLineList {
id: string;
item: number;
conta: string | null;
linha: string | null;
chip: string | null;
cliente: string | null;
usuario: string | null;
planoContrato: string | null;
status: string | null;
skil: string | null;
modalidade: string | null;
vencConta: string | null;
}
export interface MobileLineDetail extends MobileLineList {
franquiaVivo?: number | null;
valorPlanoVivo?: number | null;
gestaoVozDados?: number | null;
skeelo?: number | null;
vivoNewsPlus?: number | null;
vivoTravelMundo?: number | null;
vivoGestaoDispositivo?: number | null;
valorContratoVivo?: number | null;
franquiaLine?: number | null;
franquiaGestao?: number | null;
locacaoAp?: number | null;
valorContratoLine?: number | null;
desconto?: number | null;
lucro?: number | null;
dataBloqueio?: string | null;
cedente?: string | null;
solicitante?: string | null;
dataEntregaOpera?: string | null;
dataEntregaCliente?: string | null;
}
@Injectable({ providedIn: 'root' })
export class LinesService {
// ajuste aqui conforme sua API (mesmo host do auth)
private baseUrl = 'http://localhost:5000/api/lines';
constructor(private http: HttpClient) {}
getLines(page: number, pageSize: number, search: string): Observable<PagedResult<MobileLineList>> {
let params = new HttpParams()
.set('page', page)
.set('pageSize', pageSize);
if (search?.trim()) params = params.set('search', search.trim());
return this.http.get<PagedResult<MobileLineList>>(this.baseUrl, { params });
}
getById(id: string): Observable<MobileLineDetail> {
return this.http.get<MobileLineDetail>(`${this.baseUrl}/${id}`);
}
update(id: string, payload: any): Observable<void> {
return this.http.put<void>(`${this.baseUrl}/${id}`, payload);
}
delete(id: string): Observable<void> {
return this.http.delete<void>(`${this.baseUrl}/${id}`);
}
importExcel(file: File): Observable<{ imported: number }> {
const form = new FormData();
form.append('file', file);
return this.http.post<{ imported: number }>(`${this.baseUrl}/import-excel`, form);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 MiB

View File

@ -1,4 +0,0 @@
export const environment = {
production: false,
apiUrl: 'https://localhost:7205'
};

View File

@ -7,7 +7,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@400;700&display=swap" rel="stylesheet">
<!-- Dentro de index.html, na seção <head> -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">