/* ========================================
   RESET E BASE
   ======================================== */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
	font-family: Arial, sans-serif; 
	background-color: #f4f6f8; 
	color: #333; 
	margin: 0; 
	padding: 0;
}

main {
    flex: 1;
}

html {
    scroll-behavior: smooth;
}

/* ========================================
   HEADER
   ======================================== */
header {
    background-color: #212529;
    padding: 10px;
}

header .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h2 {
    margin: 0;
    color: yellow;
    text-align: center;
    flex: 1;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

a {
    text-decoration: none;
}

.btn-header {
    padding: 6px 10px;
    border-radius: 4px;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    box-sizing: border-box;
}

.btn-home {
    background-color: #0156B3;
}

.btn-home:hover {
    background-color: #014a9a;
}

.btn-home i {
    margin-right: 5px;
}

.btn-logout {
    background-color: #e74c3c;
}

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

.btn-header.btn-manual {
    background-color: #205081;
}

.btn-header.btn-manual svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* ========================================
   BOTÕES
   ======================================== */
button, .btn {
    background-color: #3498db;
    color: white;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

button:hover, .btn:hover {
    background-color: #2980b9;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-success {
    background-color: #27ae60;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-purple {
    background-color: #9b59b6;
}

.btn-purple:hover {
    background-color: #8e44ad;
}

.btn-gray {
    background-color: #6c757d;
}

.btn-gray:hover {
    background-color: #5a6268;
}

.btn-small {
    padding: 6px 8px;
    font-size: 13px;
}

.btn-small i {
    margin-right: 3px;
}

.btn-large {
    padding: 12px 30px;
}

.btn-action-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-group {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.btn-inline {
    margin-right: 5px;
}

/* ========================================
   CONTAINER
   ======================================== */
.container {
    max-width: 1400px;
    margin: auto;
    padding: 15px;
}

.container-narrow {
    max-width: 80%;
    width: 80%;
    margin: auto;
    padding: 15px;
}

.container-extra-narrow {
    max-width: 800px;
    margin: auto;
    padding: 20px;
}

/* ========================================
   TABELAS
   ======================================== */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 15px 0;
    background-color: white;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    white-space: nowrap;
}

th {
    background-color: #f0f0f0;
}

tr:nth-child(even) {
    background-color: #fafafa;
}

tr:hover {
    background-color: #f5f5f5;
}

table.fixed-layout {
    table-layout: fixed;
    white-space: nowrap;
}

td.ellipsis, th.ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
}

td.center, th.center {
    text-align: center;
}

/* ========================================
   FORMULÁRIOS
   ======================================== */
input, select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    width: 100%;
    margin-top: 5px;
}

label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
}

input[readonly] {
    background-color: #f5f5f5;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-style: italic;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-row input {
    flex: 1;
}

/* ========================================
   MENSAGENS
   ======================================== */
.msg-success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-left: 4px solid #28a745;
    margin: 20px 0;
    border-radius: 4px;
}

.msg-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-left: 4px solid #dc3545;
    margin: 20px 0;
    border-radius: 4px;
}

.msg-warning {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-left: 4px solid #ffc107;
    margin: 20px 0;
    border-radius: 4px;
}

.msg-info {
    background: #e8f4f8;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.msg-info i {
    color: #3498db;
    margin-right: 8px;
}

/* ========================================
   LEGENDAS
   ======================================== */
.legenda {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.legenda-danger {
    border-left-color: #e74c3c;
}

.legenda-item {
    margin-left: 15px;
}

.legenda-item i {
    margin-right: 5px;
}

.icon-representante {
    color: #3498db;
}

.icon-cliente {
    color: #27ae60;
}

.icon-master {
    color: #e74c3c;
}

.icon-admin {
    color: #3498db;
}

.icon-size-large {
    font-size: 20px;
}

.icon-inline {
    margin-left: 5px;
}

/* ========================================
   MODAL
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 900px;
    border-radius: 8px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.buscar-btn {
    background-color: #27ae60;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
}

.buscar-btn:hover {
    background-color: #229954;
}

.buscar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.resultado-busca {
    margin-top: 15px;
}

.resultado-busca table {
    width: 100%;
}

.resultado-busca tr {
    cursor: pointer;
}

.resultado-busca tr:hover {
    background-color: #e8f5e9;
}

/* ========================================
   CAMPOS DINÂMICOS
   ======================================== */
.campo-condicional {
    display: none;
}

.campo-condicional.show,
.campo-condicional[style*="block"] {
    display: block !important;
}

.nome-validacao {
    display: block;
    margin-top: 5px;
    font-weight: bold;
    color: #555;
}

.nome-validacao.success {
    color: green;
}

.nome-validacao.error {
    color: red;
}

.msg-validacao {
    background: #f8d7da;
    color: #721c24;
    padding: 8px;
    border-left: 4px solid #dc3545;
    border-radius: 4px;
    margin-top: 5px;
    font-size: 14px;
}

.input-valid {
    border-color: #28a745;
}

.input-invalid {
    border-color: #dc3545;
}

/* ========================================
   UTILITÁRIOS
   ======================================== */
.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
}

.flex-center {
    display: flex;
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-10 {
    gap: 10px;
}

.gap-15 {
    gap: 15px;
}

.margin-top-15 {
    margin-top: 15px;
}

.margin-top-20 {
    margin-top: 20px;
}

.margin-top-30 {
    margin-top: 30px;
}

.margin-bottom-15 {
    margin-bottom: 15px;
}

.margin-bottom-20 {
    margin-bottom: 20px;
}

.text-center {
    text-align: center;
}

.text-gray {
    color: #999;
}

.text-small {
    font-size: 13px;
}

.hidden {
    display: none;
}

/* ========================================
   CAMPOS DE ARQUIVO
   ======================================== */
.file-input {
    padding: 10px;
    border: 2px dashed #ccc;
    border-radius: 4px;
    width: 100%;
    margin-top: 10px;
}

/* ========================================
   INSTRUÇÕES E EXEMPLOS
   ======================================== */
.instrucoes-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.instrucoes-box ol {
    line-height: 1.8;
}

.exemplo-box {
    background: #e8f4f8;
    padding: 15px;
    border-left: 4px solid #3498db;
    margin-top: 15px;
}

.exemplo-box code {
    display: block;
    margin-top: 10px;
    padding: 10px;
    background: white;
    border-radius: 4px;
}

/* ========================================
   GRÁFICOS
   ======================================== */
.graficos-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.grafico-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.grafico-box h3 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.chart-container {
    position: relative;
    height: 400px;
    margin-top: 20px;
}

.filtro-container {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filtro-container form {
    display: flex;
    align-items: center;
    gap: 15px;
}

.filtro-container label {
    font-weight: bold;
    margin: 0;
}

.filtro-container select {
    width: auto;
    margin: 0;
    min-width: 150px;
}

@media (max-width: 1200px) {
    .graficos-container {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   CONFIGURAÇÕES
   ======================================== */
.config-info {
    background: #e8f4f8;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.config-info i {
    color: #3498db;
    margin-right: 8px;
}

/* ========================================
   MANUAL
   ======================================== */
body.manual-page-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.manual-page-body main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Container Principal do Manual - Layout 2 Colunas */
.manual-page-wrapper {
    display: flex;
    flex: 1;
    background-color: white;
    min-height: calc(100vh - 140px);
}

/* Sidebar de Navegação */
.manual-sidebar-nav {
    width: 280px;
    background-color: white;
    border-right: 1px solid #e0e0e0;
    padding: 30px 20px;
    overflow-y: auto;
    position: sticky;
    top: 60px;
    height: calc(100vh - 140px);
    flex-shrink: 0;
}

.sidebar-content {
    position: sticky;
    top: 0;
}

.sidebar-title {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.manual-nav-menu {
    margin: 0;
}

.nav-numbered-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: nav-counter;
}

.nav-list-item {
    counter-increment: nav-counter;
    margin-bottom: 10px;
}

.nav-link-item {
    display: block;
    padding: 10px 12px;
    color: #3498db;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    position: relative;
    padding-left: 35px;
    font-size: 14px;
    line-height: 1.5;
}

.nav-link-item::before {
    content: counter(nav-counter) ".";
    position: absolute;
    left: 12px;
    color: #666;
    font-weight: bold;
}

.nav-link-item:hover {
    background-color: #f0f7ff;
    color: #2980b9;
}

.nav-link-item:active,
.nav-link-item:focus {
    background-color: #e8f4f8;
    color: #1e7e34;
}

/* Conteúdo Principal */
.manual-main-content {
    flex: 1;
    padding: 40px 50px;
    background-color: white;
    overflow-y: auto;
}

.manual-content-inner {
    max-width: 100%;
    line-height: 1.8;
    color: #333;
}

.manual-content-inner h1 {
    display: none;
}

.manual-main-title {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0 0 30px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #3498db;
}

.manual-audio-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #212529;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
}

.manual-audio-section .audio-label {
    font-weight: bold;
    color: white;
    font-size: 1em;
    white-space: nowrap;
}

.manual-audio-section .headset-icon {
    width: 24px;
    height: 24px;
    fill: white;
    flex-shrink: 0;
}

.manual-audio-section audio {
    flex: 1;
    min-width: 250px;
    max-width: 500px;
    height: 40px;
}

.manual-audio-section audio::-webkit-media-controls-panel {
    background-color: white;
}

.manual-audio-section audio::-webkit-media-controls-play-button,
.manual-audio-section audio::-webkit-media-controls-pause-button {
    background-color: #333;
    border-radius: 50%;
}

.manual-audio-section audio::-webkit-media-controls-current-time-display,
.manual-audio-section audio::-webkit-media-controls-time-remaining-display {
    color: #333;
}

.manual-audio-section audio::-webkit-media-controls-timeline {
    background-color: #ddd;
}

.manual-audio-section audio::-webkit-media-controls-volume-slider {
    background-color: #ddd;
}

.manual-audio-section audio::-webkit-media-controls-mute-button {
    background-color: white;
}

.manual-content-inner h2 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: bold;
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    scroll-margin-top: 100px;
    scroll-behavior: smooth;
}

html {
    scroll-behavior: smooth;
}

.manual-content-inner h3 {
    color: #34495e;
    font-size: 20px;
    margin-top: 30px;
    margin-bottom: 15px;
}

.manual-content-inner h4,
.manual-content-inner h5,
.manual-content-inner h6 {
    color: #555;
    margin-top: 25px;
    margin-bottom: 12px;
}

.manual-content-inner p {
    margin-bottom: 15px;
    color: #333;
}

.manual-content-inner ul,
.manual-content-inner ol {
    padding-left: 30px;
    margin: 15px 0;
}

.manual-content-inner li {
    margin: 8px 0;
    color: #333;
}

.manual-content-inner ul li {
    list-style-type: square;
}

.manual-content-inner code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.manual-content-inner pre {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    border-left: 4px solid #3498db;
}

.manual-content-inner pre code {
    background: none;
    padding: 0;
}

.manual-content-inner table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.manual-content-inner th,
.manual-content-inner td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.manual-content-inner th {
    background-color: #f0f0f0;
    font-weight: bold;
}

.manual-content-inner blockquote {
    border-left: 4px solid #3498db;
    padding-left: 15px;
    margin: 15px 0;
    color: #666;
    font-style: italic;
}

.manual-content-inner hr {
    border: none;
    border-top: 2px solid #ddd;
    margin: 30px 0;
}

.manual-content-inner a {
    color: #3498db;
    text-decoration: underline;
}

.manual-content-inner a:hover {
    color: #2980b9;
}

.manual-content-inner strong {
    color: #2c3e50;
    font-weight: bold;
}

/* Container antigo mantido para compatibilidade */
.manual-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.manual-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    line-height: 1.8;
}

.audio-player-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.headset-icon {
    width: 20px;
    height: 20px;
    fill: white;
}

.audio-label {
    font-weight: bold;
    color: white;
    font-size: 0.6em;
}

audio {
    height: 35px;
    width: 300px;
    outline: none;
}

audio::-webkit-media-controls-panel {
    background-color: white;
}

audio::-webkit-media-controls-play-button {
    background-color: #3498db;
    border-radius: 50%;
}

audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display {
    color: #333;
}

.manual-content h3 {
    color: #555;
    margin-top: 25px;
}

.manual-content h4, 
.manual-content h5, 
.manual-content h6 {
    color: #666;
}

.manual-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.manual-content pre {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    border-left: 4px solid #3498db;
}

.manual-content pre code {
    background: none;
    padding: 0;
}

.manual-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.manual-content th, 
.manual-content td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.manual-content th {
    background-color: #f0f0f0;
    font-weight: bold;
}

.manual-content blockquote {
    border-left: 4px solid #3498db;
    padding-left: 15px;
    margin: 15px 0;
    color: #666;
    font-style: italic;
}

.manual-content ul, 
.manual-content ol {
    padding-left: 30px;
    margin: 15px 0;
}

.manual-content li {
    margin: 5px 0;
}

.manual-content hr {
    border: none;
    border-top: 2px solid #ddd;
    margin: 30px 0;
}

.manual-content a {
    color: #3498db;
    text-decoration: none;
}

.manual-content a:hover {
    text-decoration: underline;
}

.manual-content strong {
    color: #2c3e50;
}

.manual-actions {
    margin: 20px 0;
    text-align: center;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    background-color: #f1f1f1;
    padding: 10px;
    text-align: center;
}

.app-footer {
    background: var(--brand-bg, #212529);
    color: #fff;
    padding: 6px 12px;
    font-size: 14px;
	border-radius: 0px;
}

.footer-wrap {
    max-width: 1080px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
}

.footer-left {
    display: flex;
    align-items: center;
}

.footer-logo {
    height: 30px;
    width: auto;
}

.footer-center {
    text-align: center;
    font-weight: 600;
}

.footer-right {
    min-width: 20px;
}

.footer-right span {
    color: white;
}

/* ========================================
   DASHBOARD
   ======================================== */
.dashboard-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-title a {
    color: #e74c3c;
    font-size: 24px;
    text-decoration: none;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.dashboard-actions-left {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ========================================
   FILTROS
   ======================================== */
.filtro-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.filtro-form label {
    margin: 0;
    margin-top: 0;
}

.filtro-form select {
    width: auto;
    margin: 0;
    padding: 6px 10px;
    box-sizing: border-box;
    height: 32px;
}

.filtro-form input[type="text"] {
    width: 150px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 0;
    box-sizing: border-box;
    height: 32px;
}

.filtro-form .btn {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    height: 32px;
    box-sizing: border-box;
}

.filtro-form .btn i {
    margin-right: 5px;
}

/* ========================================
   RESPONSIVO
   ======================================== */
/* Responsivo para Manual */
@media (max-width: 1024px) {
    .manual-page-wrapper {
        flex-direction: column;
    }
    
    .manual-sidebar-nav {
        width: 100%;
        position: relative;
        top: 0;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        max-height: 300px;
    }
    
    .sidebar-content {
        position: relative;
    }
    
    .manual-main-content {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .footer-logo {
        height: 18px;
    }
    
    .app-footer {
        font-size: 13px;
        padding: 5px 10px;
    }
    
    .container-narrow {
        max-width: 100%;
        width: 100%;
    }
    
    .manual-sidebar-nav {
        padding: 20px 15px;
        max-height: 250px;
    }
    
    .manual-main-content {
        padding: 20px 15px;
    }
}
