:root {
    --cor-fundo-pagina: #f3f4f6;
}

body.app-body {
    margin: 0;
    padding: 0;
    background-color: var(--cor-fundo-pagina);
    font-family: 'Inter', sans-serif;
}

.content-wrapper {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
}

.content-body {
    display: flex;
    flex-direction: row;
}

.dashboard-main-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar {
    
    height: calc(100vh - 60px); 
    overflow-y: auto; 
    padding-top: 20px; 
    padding-right: 0;
    padding-left: 0;
    padding-bottom: 0; 
    box-sizing: border-box;
}

body {
    position: relative;
}

.main-footer {
    position: relative;
    z-index: 200;
}

.sidebar-header {
    padding: 0 20px;
    margin-bottom: 30px;
    
}

.admin-badge {
    display: inline-block;
    background-color: #ff5722;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
}

.user-greeting {
    padding: 0 20px;
    margin-bottom: 30px;
}

.user-greeting h2 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0 20px;
}

.sidebar-link {
    display: block;
    background-color: #ff5722;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.sidebar-link:hover {
    background-color: #f4511e;
    transform: translateX(5px);
}

.sidebar-link.active {
    background-color: #e64a19;
}

.sidebar-spacer {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chatbot-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    width: 100%;
}

.chatbot-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

.chatbot-btn i {
    font-size: 24px;
    animation: bounce 2s infinite;
}

.chatbot-btn span:not(.chat-badge) {
    font-size: 12px;
}

.chat-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #ff3b30;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.sidebar-footer {
    padding: 0 20px;
    margin-top: auto;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #ff5722;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background-color: #f4511e;
}

.logout-btn i {
    font-size: 16px;
}

@media (max-width: 768px) {
    .content-body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .dashboard-main-area,
    .main-content {
        margin-top: 60px;
        margin-left: 0;
        flex: 1;
        padding: 20px;
    }

    .app-container {
    display: flex;
    min-height: 100vh;
}

}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}



/* chatbot */

.chatbot-window {
    position: fixed;
    right: 20px;
    width: 320px;
    height: 420px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000; /* above sidebar */
    bottom: 20px;   /* initial spacing from bottom */
    transition: bottom 0.2s ease;
}


.hidden {
    display: none !important;
}

.chat-header {
    background: #1e293b;
    color: white;
    padding: 10px 15px;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-body {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: #f8fafc;
}

.chat-message {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    max-width: 80%;
}

.chat-message.bot {
    background: #e2e8f0;
    align-self: flex-start;
}

.chat-message.user {
    background: #4ade80;
    color: #000;
    align-self: flex-end;
}

.chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ddd;
    background: #ffffff;
}

.chat-input input {
    flex: 1;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
}

.chat-input button {
    margin-left: 8px;
    padding: 8px 12px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.close-chat {
    background: transparent;
    color: white;
    border: none;
    font-size: 22px;
    cursor: pointer;
}

.admin-badge {
    background-color: #2c4da5 !important; 
    color: #ffffff; 
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: default;
    border: none;
}