/* ================================================= */
/* ===                 LAYOUT.CSS                === */
/* ================================================= */

.main-container { display: flex; position: relative; }
.container-fluid { padding: 20px; }
@media (max-width: 360px) { .container-fluid { padding-left: 10px; padding-right: 10px; } }

/* --- Sidebar --- */
.sidebar {
    width: 250px; background-color: var(--secondary-color); color: var(--text-light-color);
    height: 100vh; position: fixed; top: 0; left: 0; z-index: 1100;
    transform: translateX(-100%); transition: transform 0.3s ease-in-out, background-color 0.3s;
}
.sidebar.visible { transform: translateX(0); }

.sidebar-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 15px; border-bottom: 1px solid #4a627a;
}
.sidebar-header h3 { margin: 0; font-size: 1.5em; }

.close-sidebar-btn { background: none; border: none; color: var(--text-light-color); font-size: 2em; cursor: pointer; }
.sidebar-menu { list-style: none; margin-top: 20px; }

.sidebar-btn {
    display: flex; align-items: center; gap: 15px; background: none; border: none;
    color: var(--text-light-color); padding: 15px; width: 100%; text-align: left;
    font-size: 1em; cursor: pointer; border-radius: 5px; transition: background-color 0.3s;
}
.sidebar-btn:hover, .sidebar-btn.active { background-color: #4a627a; }
.sidebar-btn i { width: 20px; }

/* Badge de mensagens não lidas no botão Chat WhatsApp da sidebar */
.wa-sidebar-badge {
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    padding: 0 6px;
    margin-left: auto;
    animation: waSidebarPulse 2.5s ease-in-out infinite;
}
@keyframes waSidebarPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* --- Content Wrapper --- */
.content { width: 100%; transition: margin-left 0.3s ease-in-out; }
@media (min-width: 992px) {
    .sidebar { transform: translateX(0); }
    .content { margin-left: 250px; }
    .mobile-menu-btn, .close-sidebar-btn { display: none; }
    .main-header { justify-content: center; }
}

/* --- Main Header --- */
.main-header {
    display: flex; align-items: center; background-color: var(--header-bg-color);
    padding: 10px 20px; box-shadow: 0 2px 4px var(--box-shadow-color);
    transition: background-color 0.3s;
}
.main-header h1 { font-size: 1.5em; color: var(--primary-color); }
@media (max-width: 768px) { .main-header h1 { font-size: 1.2em; } }

.mobile-menu-btn {
    background: none; border: none; font-size: 1.5em; color: var(--text-color);
    cursor: pointer; margin-right: 15px;
}

/* --- Theme Toggle Button --- */
.theme-toggle-btn {
    background: none; border: none; color: var(--text-light-color);
    width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
    font-size: 1.2em; display: flex; justify-content: center; align-items: center;
    transition: color 0.3s, background-color 0.3s, transform 0.3s; margin-right: 10px;
}
.theme-toggle-btn:hover { background-color: rgba(255, 255, 255, 0.2); transform: scale(1.1); }

/* --- Navegação entre Clientes (Header Modal) --- */
.nav-btn {
    background: none; border: 1px solid var(--input-border-color); color: var(--text-color);
    width: 40px; height: 40px; border-radius: 50%; font-size: 1em; cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}
.nav-btn:hover:not(:disabled) {
    background-color: var(--primary-color); color: var(--text-light-color); border-color: var(--primary-color);
}
.nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.modal-header-nav {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 25px; margin-top: 10px; text-align: center;
}
.modal-header-nav h2 { margin: 0; flex-grow: 1; }

@media (max-width: 768px) {
    .modal-header-nav { display: grid; justify-items: center; gap: 1px; }
    .modal-header-nav h2 { grid-row: 1; grid-column: 1 / 3; flex-grow: 0; }
    #prev-client-btn { grid-row: 2; grid-column: 1; }
    #next-client-btn { grid-row: 2; grid-column: 2; }
}

/* --- Scroll To Top --- */
#scrollToTopBtn {
  display: none; position: fixed; bottom: 20px; right: 30px; z-index: 1080;
  border: none; outline: none; background-color: var(--primary-color); color: white;
  cursor: pointer; border-radius: 50%; font-size: 1.2rem; width: 50px; height: 50px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity 0.4s, visibility 0.4s, background-color 0.3s;
}
#scrollToTopBtn.show { opacity: 1; visibility: visible; }
#scrollToTopBtn:hover { background-color: #2980b9; }