/* ======================================================
   STYLE.CSS
   ------------------------------------------------------
   Folha de estilos global da aplicação Cashen.

   Responsável por:
   • Layout principal da aplicação
   • Sidebar e navegação
   • Componentes globais
   • Sistema de temas (Light / Dark)
   • Modais e notificações
   • Responsividade da interface

   Cada seção é organizada por responsabilidade para
   facilitar manutenção e escalabilidade.
   ====================================================== */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Poppins:wght@400;500;600;700&display=swap');

/* ======================================================
   RESET GLOBAL
   ------------------------------------------------------
   Normalização básica de margens, espaçamentos e
   comportamento padrão dos elementos HTML.
   ====================================================== */

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

/* ======================================================
   ELEMENTOS BASE
   ------------------------------------------------------
   Configurações globais para links, listas e demais
   elementos estruturais da interface.
   ====================================================== */

a {
	text-decoration: none;
}

li {
	list-style: none;
}

/* ======================================================
   TOKENS DE DESIGN
   ------------------------------------------------------
   Variáveis globais de cores, tipografia, espaçamentos
   e configurações reutilizadas em toda a aplicação.
   ====================================================== */

:root {
	--poppins: 'Poppins', sans-serif;
	--lato: 'Lato', sans-serif;
	--light: #F9F9F9;
	--blue: #29c04c;
	--light-blue: #CFE8FF;
	--grey: #e5e2e2;
	--dark-grey: #AAAAAA;
	--dark: #342E37;
	--red: #DB504A;
	--yellow: #FFCE26;
	--light-yellow: #FFF2C6;
	--orange: #FD7238;
	--light-orange: #FFE0D3;
	--green: #3a9406;
	--light-green: #dbf9c9;

	  /* TEMPLATE MODAL */
  --modal-bg: #ffffff;
  --modal-secondary: #f1f5f9;
  --modal-card: #ffffff;
  --modal-border: #e2e8f0;
  --modal-text: #0f172a;
  --modal-subtext: #64748b;
  --modal-preview: #f8fafc;
  --modal-preview-border: #eef2f7;
  --modal-divider: #e9eef5;
  --modal-button: #3C91E6;
  --modal-button-hover: #2563eb;
  --modal-shadow: 0 30px 80px rgba(15, 23, 42, .18);

  /* novos tokens */
  --modal-overlay: rgba(15, 23, 42, .35);
  --modal-header-icon-bg: linear-gradient(135deg, #dbeafe, #eff6ff);
  --modal-close-bg: #ffffff;
  --modal-close-border: #e2e8f0;
  --modal-footer-hover: #f8fafc;
  --modal-badge-bg: linear-gradient(135deg, #fb923c, #f97316);
  --modal-badge-color: #ffffff;
  --modal-select-orange-bg: #ffedd5;
  --modal-select-orange-color: #ea580c;
  --modal-select-orange-hover: #fed7aa;
  --modal-select-blue-bg: #dbeafe;
  --modal-select-blue-color: #2563eb;
  --modal-select-blue-hover: #bfdbfe;
  --modal-expense-color: #ef4444;
  --modal-dots: #cbd5e1;
}

html {
	overflow-x: hidden;
}

/* ======================================================
   TEMA ESCURO
   ------------------------------------------------------
   Sobrescreve os tokens globais para aplicação do
   modo escuro em toda a interface.
   ====================================================== */

body.dark {
	--light: #141427;
	--grey: #282a40;
	--dark: #FBFBFB;

	/* TEMPLATE MODAL */
  --modal-bg: #1c1e38;
  --modal-secondary: #242742;
  --modal-card: #1f2240;
  --modal-border: rgba(255,255,255,.07);
  --modal-text: #ffffff;
  --modal-subtext: #b7bdd1;
  --modal-preview: rgba(0,0,0,.25);
  --modal-preview-border: rgba(255,255,255,.05);
  --modal-divider: rgba(255,255,255,.06);
  --modal-button: #3C91E6;
  --modal-button-hover: #60a5fa;
  --modal-shadow: 0 25px 80px rgba(0,0,0,.55);
  --modal-overlay: rgba(0, 0, 0, .55);
  --modal-header-icon-bg: linear-gradient(135deg, rgba(60,145,230,.25), rgba(60,145,230,.10));
  --modal-close-bg: #242742;
  --modal-close-border: rgba(255,255,255,.08);
  --modal-footer-hover: rgba(255,255,255,.04);
  --modal-badge-bg: linear-gradient(135deg, #fb923c, #f97316);
  --modal-badge-color: #ffffff;
  --modal-select-orange-bg: rgba(249, 115, 22, .15);
  --modal-select-orange-color: #fdba74;
  --modal-select-orange-hover: rgba(249, 115, 22, .25);
  --modal-select-blue-bg: rgba(59, 130, 246, .18);
  --modal-select-blue-color: #93c5fd;
  --modal-select-blue-hover: rgba(59, 130, 246, .28);
  --modal-expense-color: #f87171;
  --modal-dots: rgba(255,255,255,.18);
}

/* ======================================================
   ESTRUTURA GLOBAL
   ------------------------------------------------------
   Configurações gerais do documento e comportamento
   principal da área visível da aplicação.
   ====================================================== */

body {
	background: var(--grey);
	overflow-x: hidden;
}

/* ======================================================
   SIDEBAR
   ------------------------------------------------------
   Navegação lateral principal da aplicação, incluindo
   logo, menus, estados ativos e colapsados.
   ====================================================== */ 

#sidebar {
	position: fixed;
	top: 0;
	left: 0;
	width: 280px;
	height: 100%;
	background: var(--light);
	z-index: 2000;
	font-family: var(--lato);
	transition: .3s ease;
	overflow-x: hidden;
	scrollbar-width: none;
}

#sidebar::--webkit-scrollbar {
	display: none;
}

#sidebar.hide {
	width: 60px;
}

#sidebar .brand {
	font-size: 24px;
	font-weight: 700;
	height: 56px;
	display: flex;
	align-items: center;
	color: var(--blue);
	position: sticky;
	top: 0;
	left: 0;
	background: var(--light);
	z-index: 500;
	padding-bottom: 20px;
	box-sizing: content-box;
}

#sidebar .brand .bx {
	min-width: 60px;
	display: flex;
	justify-content: center;
}

#sidebar .side-menu {
	width: 100%;
	margin-top: 48px;
}

#sidebar .side-menu li {
	height: 48px;
	background: transparent;
	margin-left: 6px;
	border-radius: 48px 0 0 48px;
	padding: 4px;
}

#sidebar .side-menu li.active {
	background: var(--grey);
	position: relative;
}

#sidebar .side-menu li.active::before {
	content: '';
	position: absolute;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	top: -40px;
	right: 0;
	box-shadow: 20px 20px 0 var(--grey);
	z-index: -1;
}

#sidebar .side-menu li.active::after {
	content: '';
	position: absolute;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	bottom: -40px;
	right: 0;
	box-shadow: 20px -20px 0 var(--grey);
	z-index: -1;
}

#sidebar .side-menu li a {
	width: 100%;
	height: 100%;
	background: var(--light);
	display: flex;
	align-items: center;
	border-radius: 48px;
	font-size: 16px;
	color: var(--dark);
	white-space: nowrap;
	overflow-x: hidden;
}

#sidebar .side-menu.top li.active a {
	color: var(--blue);
}

#sidebar.hide .side-menu li a {
	width: calc(48px - (4px * 2));
	transition: width .3s ease;
}

#sidebar .side-menu li a.logout {
	color: var(--red);
}

#sidebar .side-menu.top li a:hover {
	color: var(--blue);
}

#sidebar .side-menu li a .bx {
	min-width: calc(60px - ((4px + 6px) * 2));
	display: flex;
	justify-content: center;
}

/* ======================================================
   ÁREA DE CONTEÚDO
   ------------------------------------------------------
   Container principal responsável pela exibição das
   páginas carregadas dinamicamente.
   ====================================================== */

#content {
	position: fixed;
	top: 0;
	right: 0;
	width: calc(100% - 280px);
	height: 100vh;
	left: 280px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: .3s ease;
}

#content main {
	flex: 1;
	overflow-y: auto;
}

#sidebar.hide~#content {
	width: calc(100% - 60px);
	left: 60px;
}

/* ======================================================
   NAVBAR
   ------------------------------------------------------
   Barra superior da aplicação contendo navegação,
   pesquisa, notificações e perfil do usuário.
   ====================================================== */

#content nav {
	height: 56px;
	background: var(--light);
	padding: 0 24px;
	display: flex;
	align-items: center;
	grid-gap: 24px;
	font-family: var(--lato);
	position: sticky;
	top: 0;
	left: 0;
	z-index: 1000;
}

#content nav::before {
	content: '';
	position: absolute;
	width: 40px;
	height: 40px;
	bottom: -40px;
	left: 0;
	border-radius: 50%;
	box-shadow: -20px -20px 0 var(--light);
}

#content nav a {
	color: var(--dark);
}

#content nav .bx.bx-menu {
	cursor: pointer;
	color: var(--dark);
}

#content nav .nav-link {
	font-size: 16px;
	transition: .3s ease;
}

#content nav .nav-link:hover {
	color: var(--blue);
}

/* ======================================================
   CAMPO DE PESQUISA
   ------------------------------------------------------
   Estrutura visual do mecanismo de busca exibido
   na barra superior da aplicação.
   ====================================================== */

#content nav form {
	max-width: 400px;
	width: 100%;
	margin-right: auto;
}

#content nav form .form-input {
	display: flex;
	align-items: center;
	height: 36px;
}

#content nav form .form-input input {
	flex-grow: 1;
	padding: 0 16px;
	height: 100%;
	border: none;
	background: var(--grey);
	border-radius: 36px 0 0 36px;
	outline: none;
	width: 100%;
	color: var(--dark);
}

#content nav form .form-input button {
	width: 36px;
	height: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	background: var(--blue);
	color: var(--light);
	font-size: 18px;
	border: none;
	outline: none;
	border-radius: 0 36px 36px 0;
	cursor: pointer;
}

/* ======================================================
   NOTIFICAÇÕES
   ------------------------------------------------------
   Indicadores visuais de alertas e quantidade de
   notificações pendentes.
   ====================================================== */

#content nav .notification {
	font-size: 20px;
	position: relative;
}

#content nav .notification .num {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid var(--light);
	background: var(--red);
	color: var(--light);
	font-weight: 700;
	font-size: 12px;
	display: flex;
	justify-content: center;
	align-items: center;
}

/* ======================================================
   PERFIL DO USUÁRIO
   ------------------------------------------------------
   Avatar e elementos visuais relacionados à conta
   do usuário autenticado.
   ====================================================== */

#content nav .profile img {
	width: 36px;
	height: 36px;
	object-fit: cover;
	border-radius: 50%;
}

/* ======================================================
   ALTERNÂNCIA DE TEMA
   ------------------------------------------------------
   Controle responsável pela troca entre os modos
   claro e escuro da interface.
   ====================================================== */

#content nav .switch-mode {
	display: block;
	min-width: 50px;
	height: 25px;
	border-radius: 25px;
	background: var(--grey);
	cursor: pointer;
	position: relative;
}

#content nav .switch-mode::before {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	bottom: 2px;
	width: calc(25px - 4px);
	background: var(--blue);
	border-radius: 50%;
	transition: all .3s ease;
}

#content nav #switch-mode:checked+.switch-mode::before {
	left: calc(100% - (25px - 4px) - 2px);
}

/* ======================================================
   LOADER DA APLICAÇÃO
   ------------------------------------------------------
   Tela de carregamento exibida durante a inicialização
   e preparação dos recursos da aplicação.
   ====================================================== */

#app-loader {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background:radial-gradient(circle at top, rgba(74,158,255,0.12), transparent 40%),linear-gradient(135deg, #0d1117 0%, #111827 50%, #1a2235 100%);
	overflow: hidden;
	transition:opacity .6s ease,visibility .6s ease;
}

#app-loader.hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

/* ======================================================
   COMPONENTES DO LOADER
   ------------------------------------------------------
   Elementos visuais responsáveis pelos efeitos,
   logo e animações da tela de carregamento.
   ====================================================== */

.loader-bg-glow {
	position: absolute;
	width: 700px;
	height: 700px;
	background: radial-gradient(circle,rgba(74,158,255,0.14) 0%,transparent 70%);
	filter: blur(60px);
	animation: pulseGlow 4s ease-in-out infinite;
}

.loader-content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.loader-logo {
	position: relative;
	width: 140px;
	height: 140px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 30px;
}

.loader-logo img {
	width: 95px;
	filter: drop-shadow(0 0 20px rgba(74,158,255,0.25));
}

.loader-ring {
	position: absolute;
	width: 140px;
	height: 140px;
	border-radius: 50%;
	border: 2px solid rgba(74,158,255,0.15);
	border-top-color: #4a9eff;
	animation: spin 1.4s linear infinite;
	box-shadow: 0 0 30px rgba(74,158,255,0.18);
}

.loader-content h1 {
	font-family: 'Syne', sans-serif;
	font-size: 2.5rem;
	font-weight: 800;
	color: #e2e8f0;
	letter-spacing: 1px;
	margin-bottom: 10px;
}

.loader-content p {
	color: #94a3b8;
	font-size: 0.95rem;
	margin-bottom: 28px;
}

/* ======================================================
   ANIMAÇÕES
   ------------------------------------------------------
   Conjunto de animações utilizadas pelos componentes
   globais da aplicação.
   ====================================================== */

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes floatLogo {
	0%,100% {
		transform: translateY(0px);
	}

	50% {
		transform: translateY(-6px);
	}
}

@keyframes pulseGlow {
	0%,100% {
		transform: scale(1);
		opacity: .7;
	}

	50% {
		transform: scale(1.08);
		opacity: 1;
	}
}

@keyframes loadingBar {
	0% {
		transform: translateX(-120%);
	}

	100% {
		transform: translateX(320%);
	}
}