/* =========================
   RESET / BASE
========================= */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;

    /* Fundo gradiente */
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #2563eb 100%);
    
    min-height: 100vh;
    
}

.login-page {
    background: linear-gradient(
        135deg,
        #0f172a 0%,
        #1e293b 40%,
        #2563eb 100%
    );

    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================
   LAYOUT BASE
========================= */

.layout {
    display: flex;
}

.content {
    margin-left: 170px;
    padding: 0px;
    width: 100%;
}

/* =========================
   LAYOUT
========================= */
.container {
    padding: 10px;
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
    width: 150px;
    height: calc(100vh - 60px);
    position: fixed;
    left: 0;
    top: 60px;

    background: #0f172a;
    padding: 10px 0px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Logo / topo */
.sidebar-header {
    color: #fff;
    font-size: 18px;
    margin-bottom: 20px;
}

/* Links */
.sidebar-link {
    display: block;
    padding: 10px;
    border-radius: 0px 0px 0px 0px;

    color: #cbd5f5;
    text-decoration: none;
    margin-bottom: 5px;

    -webkit-tap-highlight-color: transparent;
    outline: none;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}       
    
/* Hover */
@media (hover: hover) {

    .sidebar-link:hover:not(.active) {

        background: rgba(255,255,255,0.06);
    }
}

.sidebar-link:focus {

    outline: none;

    background: transparent;
}

/* Ativo */
.sidebar-link.active {
    background: #444c5e;
    color: #fff;
    border-right: 3px solid #3b82f6;
    box-shadow: inset 0 0 10px rgba(59,130,246,0.2);
    font-weight: 600;
    position: relative;
    z-index: 2;
}

/* Rodapé */
.sidebar-footer {
    margin-top: 20px;
    margin-bottom: 4px;
    padding: 5px 12px;
}

.sidebar button {
    width: 100%;
    padding: 6px;
    margin-top: 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* =========================
   SUBMENU SIDEBAR
========================= */

.submenu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);

    transition: 
        max-height 0.6s ease,
        opacity 0.4s ease,
        transform 0.4s ease;
}

.has-submenu {
    cursor: pointer;
}

.submenu .sidebar-link {
    font-size: 14px;
    padding-left: 20px;
    color: #94a3b8;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.5s ease;
}

/* quando abre */
.sidebar-group.open .submenu .sidebar-link {
    opacity: 1;
    transform: translateY(0);
}

/* atraso em cascata */
.submenu .sidebar-link:nth-child(1) { transition-delay: 0.1s; }
.submenu .sidebar-link:nth-child(2) { transition-delay: 0.2s; }
.submenu .sidebar-link:nth-child(3) { transition-delay: 0.3s; }
.submenu .sidebar-link:nth-child(4) { transition-delay: 0.5s; }

.submenu .sidebar-link:hover {
    color: #fff;
}

/* quando aberto */

.sidebar-group.open .submenu {
    max-height: 500px;
    opacity: 1;
    transform: translateY(0);
}

/* botão sair */
.btn-logout {
    background: #ef4444;
    color: #fff;
}

/* botão tema */
.btn-theme {
    background: #1e293b;
    color: #fff;
}

/* =========================
   NAVBAR
========================= */

.navbar {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    height: 60px;
    background: #0f172a;

    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.3);

    z-index: 1000;
}

.navbar-logo img {
    max-width: 140px;
    margin-left: 30px;
}

/* =========================
   USER NAVBAR
========================= */

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity 0.3s ease;
}

/* =========================
   NOTIFICAÇÕES
========================= */

.navbar-notificacoes {
    position: relative;
    margin-left: auto;
    margin-right: 5px;
}

.btn-notificacoes {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: .2s;
}

.btn-notificacoes:hover {
    background: rgba(255,255,255,.12);
}

.badge-notificacoes {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 20px;
    background: #e65921;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-notificacoes {
    position: absolute;
    top: 45px;
    right: 0;
    width: 340px;
    background: #fff;
    border-radius: 12px;
    box-shadow:
        0 10px 30px rgba(0,0,0,.18);
    overflow: hidden;
    display: none;
    z-index: 9999;
}

.dropdown-notificacoes.ativo {
    display: block;
}

.notif-header {
    padding: 14px 16px;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
}

#listaNotificacoes {
    max-height: 420px;
    overflow-y: auto;
}

.notif-item {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: .2s;
}

.notif-item:hover {
    background: #f8fafc;
}

.notif-item strong {
    display: block;
    color: #111827;
    margin-bottom: 4px;
}

.notif-item span {
    color: #64748b;
    font-size: 13px;
}

.notif-empty {
    padding: 20px;
    text-align: center;
    color: #666;
}

.notif-msg {
    font-size: 13px;
    line-height: 1.4;
    color: #334155;
}

/* nome + role */
.user-info {
    text-align: right;
}

.user-info span {
    display: block;
    font-size: 14px;
    font-weight: 500;
}

.user-info small {
    font-size: 12px;
    opacity: 0.6;
}

/* avatar */
.user-avatar {
    width: 36px;
    height: 36px;
    background: #0f172a18;
    border-radius: 100%;
    border: 1px solid #6767eb2a;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #fff;
    font-weight: bold;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* X EXCLUIR NOTIFICAÇÃO */

.notif-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.notif-msg {
    flex: 1;
}

.notif-delete {
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    padding: 4px 6px;
    border-radius: 4px;
    transition: .2s;
}

.notif-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Ajustar conteúdo abaixo */
.content {
    margin-top: 60px;
}

/* =========================
NOTIFICAÇÕES - RESPONSIVO
========================= */

/* Tablets e celulares */
@media (max-width: 768px) {

.navbar-notificacoes {
    position: relative;
    margin-left: auto;
    margin-right: 4px;
    flex-shrink: 0;
}

.dropdown-notificacoes {
    position: fixed;

    /* Não ultrapassar as laterais da tela */
    width: auto;
    left: 12px;
    right: 12px;

    /* Aparecer abaixo da navbar */
    top: 60px;

    max-width: 400px;
    margin-left: auto;
    margin-right: auto;

    box-sizing: border-box;
    z-index: 99999;
}

#listaNotificacoes {
    max-height: 60vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.notif-header {
    padding: 12px 14px;
}

.notif-item {
    padding: 12px;
    gap: 8px;
}

.notif-msg {
    min-width: 0;
    overflow-wrap: anywhere;
}

}

/* Celulares estreitos */
@media (max-width: 380px) {

.dropdown-notificacoes {
    left: 8px;
    right: 8px;
    top: 55px;
}

.notif-header {
    padding: 10px 12px;
}

.notif-item {
    padding: 10px;
}

}

/* =========================
   LIGHT MODE
========================= */

[data-theme="light"] body {
    background: #f1f5f9;
}

/* sidebar */
[data-theme="light"] .sidebar {
    background: #ffffff;
}

[data-theme="light"] .sidebar-link {
    color: #334155;
}

@media (hover: hover) {

    [data-theme="light"] .sidebar-link:hover {

        background: #f1f5ff;
        color: #444c5e;
        font-weight: 600;
    }
}

/* navbar */
[data-theme="light"] .navbar {
    background: #ffffff;
    color: #000;
}

/* conteúdo */
[data-theme="light"] .content {
    background: #f8fafc00;
}

/* DARK NAVEBAR */
[data-theme="dark"] .user-info span {
    color: #fff;
}

[data-theme="dark"] .user-info small {
    color: #aaa;
}

/* LIGHT NAVBAR */
[data-theme="light"] .user-info span {
    color: #1e293b;
}

[data-theme="light"] .user-info small {
    color: #475569;
}

/* =========================
   ACTIVE - LIGHT MODE
========================= */

[data-theme="light"] .sidebar-link.active {
    background: #e0ecff; /* azul claro */
    color: #1e3a8a;
    border-right: 3px solid #3b82f6;
}

[data-theme="light"] .sidebar-link:hover {
    background: #f1f5ff;
    color: #444c5e;
    font-weight: 600;
}

[data-theme="light"] .btn-theme {
    background: #1e293b;
    color: #fff;
    font-weight: 600;
}

/* =========================
   LOGO DO LOGIN
========================= */
.logo {
    width: 120px;
    display: block;
    margin: 0 auto 5px auto;
    opacity: 0.9;
    transition: 0.3s;
}

.logo:hover {
    transform: scale(1.05);
}

/* Card principal */
.login-card {
    width: 360px;
    padding: 15px;

    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(15px);

    border-radius: 14px;
    border: 1px solid #5c6470;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* =========================
   BOTÃO LOGOUT
========================= */

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: 100%;
    padding: 10px;

    background: #ef4444;
    color: #fff;

    border: none;
    border-radius: 8px;

    cursor: pointer;
    transition: 0.2s;

    font-weight: 500;
    letter-spacing: 0.3px;
}

/* hover */
.btn-logout:hover {
    background: #dc2626;
}

/* ícone */
.logout-icon {
    width: 25px;
    height: 25px;
}

/* =========================
   HEADER
========================= */
.login-header h1 {
    color: #fff;
    margin-top: 0px;
    font-size: 30px;
}

.login-header p {
    color: #94a3b8;
    margin-bottom: 10px;
    font-size: 14px;
}

/* =========================
   FORMULÁRIO
========================= */
.form-group {
    width: 100%;
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 6px;
    color: #cbd5f5;
    font-size: 13px;
}

/* =========================
   INPUTS
========================= */
input {
    width: 100%;
    padding: 12px;

    background: linear-gradient(90deg, #1e293b, #0f172a);
    border: 1px solid #334155;
    border-radius: 8px;

    color: #fff;
    font-size: 14px;
}

/* Placeholder */
input::placeholder {
    color: #64748b;
}

/* Focus */
input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.3);
}

/* =========================
   SENHA (ÍCONE 👁️)
========================= */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    padding-right: 40px;
}

/* Botão do olho */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);

    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
}

/* =========================
   BOTÃO LOGIN
========================= */
.login-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;

    background: linear-gradient(90deg, #6366f1, #3b82f6);
    border: none;
    border-radius: 8px;

    color: white;
    font-weight: 600;

    cursor: pointer;
    transition: 0.3s;
}

/* Hover botão */
.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

/* =========================
   LINK ESQUECI SENHA
========================= */
.forgot-password {
    margin-top: 10px;
}

.link-btn {
    background: none;
    border: none;
    color: #60a5fa;
    cursor: pointer;
    font-size: 13px;
}

/* =========================
   MENSAGEM DE ERRO
========================= */
.error-message {
    display: none;
    background: #ff4d4f;
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 14px;
}

/* =========================
   SPINNER
========================= */
.spinner {
    width: 16px;
    height: 16px;

    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;

    display: inline-block;
    margin-left: 8px;

    animation: spin 0.6s linear infinite;
}

.user-info {
    max-width: 140px;
    overflow: hidden;
}

.user-info span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}



/* =========================
   MOBILE
========================= */
@media (max-width: 768px) {

    .content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }

    .navbar-logo img {
        margin-left: 0;
        max-width: 110px;
    }

    .user-avatar {
        display: none;
    }
        
}

/* =========================
   RESPONSIVO
========================= */
@media (max-width: 453px) {
    .login-card {
        width: 340px;
    }
}

/* =========================
   MOBILE SIDEBAR
========================= */

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    margin-left: 20px;
}

.hamburger span {
    width: 24px;
    height: 3px;
    border-radius: 3px;
    background: #fff;
}

/* LIGHT */
[data-theme="light"] .hamburger span {
    background: #111827;
}

/* SPINNER */
.app-loading {

    display: flex;

    justify-content: center;

    align-items: center;

    min-height: calc(100vh - 120px);

}

.app-spinner {

    width: 56px;

    height: 56px;

    border-radius: 50%;

    border: 4px solid rgba(59,130,246,.15);

    border-top-color: #3b82f6;

    animation: appSpin .8s linear infinite;
}

@keyframes appSpin {

    to {

        transform: rotate(360deg);

    }

}
/* MOBILE */
@media (max-width: 768px) {

    .hamburger {
        display: flex;
    }

    .sidebar {
        display: flex;
        position: fixed;
        
        top: 60px;
        left: 0;

        width: 260px;
        height: calc(95dvh - 60px);

        z-index: 2000;
        

        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
    }

}

.mobile-overlay {
    position: fixed;

    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;

    background: rgba(0,0,0,.5);

    opacity: 0;
    visibility: hidden;

    transition: .3s;

    z-index: 1500;
}

.mobile-overlay.show {
    opacity: 1;
    visibility: visible;
}

.hidden-navbar {
    visibility: hidden;
}

#navUserImg {
    transition: opacity .2s ease;
}

.sidebar-link:focus {

    box-shadow: none !important;
    outline: none !important;
}

/* =========================
   VIEW TRANSITION
========================= */

#appContent {

    opacity: 1;
    transform: translateY(0);
    transition:
        opacity .32s ease,
        transform .32s ease;
}

#appContent.view-leave {

    opacity: 0;
    transform: translateY(12px);
}

#appContent.view-enter {

    opacity: 1;
    transform: translateY(0);
}

#perfilFoto {

    opacity: 1;
    transition: opacity .15s ease;
}

#perfilFoto[src=""] {

    opacity: 0;
}

