/* Hub - Tema We Digital */

:root {
    --we-digital-orange: #F18622;
    --primary: var(--we-digital-orange);
    --secondary: #6c757d;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #d92550;
    --light: #f8f9fa;
    --dark: #343a40;
    --focus: rgba(241, 134, 34, 0.25);
    --sidebar-bg: #343a40;
    --sidebar-text: #ffffff;
    --page-bg: #f4f6f9;
    --text-primary: #212529;
    --text-secondary: #6c757d;
}

/* Base Typography */
body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; font-weight: 700; }
h6 { font-size: 1rem; font-weight: 700; }

/* Layout principal */
.app-container {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    width: 100%;
}

.app-main {
    display: flex;
    flex-direction: row;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

.app-main__outer {
    flex: 1;
    padding-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    background-color: var(--page-bg);
}

.app-main__inner {
    flex: 1;
    padding: 0.75rem 0.5rem !important;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    margin: 0;
}

/* Barra lateral */
.app-sidebar {
    position: fixed;
    width: 280px;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 10;
    background: var(--sidebar-bg);
    box-shadow: 0 0.46875rem 2.1875rem rgba(0,0,0,.03), 
                0 0.9375rem 1.40625rem rgba(0,0,0,.03), 
                0 0.25rem 0.53125rem rgba(0,0,0,.05), 
                0 0.125rem 0.1875rem rgba(0,0,0,.03);
    transition: all .2s;
}

.app-sidebar__header {
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background-color: rgba(0,0,0,0.2);
    color: var(--sidebar-text);
    text-align: center;
}

.app-sidebar__header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 400;
}

.app-sidebar__header .logo-container {
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    border-radius: 5px;
    padding: 5px;
    margin-bottom: 10px;
}

.app-sidebar__header img.logo {
    max-width: 120px;
    max-height: 40px;
    height: auto;
    object-fit: contain;
}

/* Mobile Sidebar Toggle */
.app-sidebar-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 20;
    background-color: var(--primary);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

/* Badge Colors */
.badge.bg-warning {
    background-color: var(--warning) !important;
    color: var(--dark);
}

/* Botoes Primary */
.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

.btn-primary:hover {
    background-color: #d76f17 !important;
    border-color: #d76f17 !important;
    color: #fff !important;
    filter: brightness(100%);
}

/* Nav Menu Active */
.vertical-nav-menu .menu-item.mm-active,
.vertical-nav-menu li a.mm-active {
    background: var(--primary);
    color: white;
}

/* Table Styles with more visibility */
.table {
    width: 100%;
    margin-bottom: 1rem;
    background-color: #fff;
    color: #212529;
    border: 1px solid #e0e0e0;
}

.table-bordered {
    border: 1px solid #dee2e6;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #dee2e6;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.03);
}

.table-hover tbody tr:hover {
    background-color: rgba(241, 134, 34, 0.075);
    color: var(--text-primary);
}

.table th {
    padding: 0.75rem;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
    background-color: var(--light);
    font-weight: 600;
}

.table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
    color: #212529;
}

/* Garantir que o texto nas tabelas seja visível */
.table-hover tbody tr, 
.table-hover tbody tr td {
    color: var(--text-primary);
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Form Focus */
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem var(--focus);
}

/* Select2 Custom Styles */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary);
    color: white;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--primary);
    border-color: #0056b3;
    color: white;
}

/* DataTables */
.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

.page-link {
    color: var(--primary);
}

.page-link:hover {
    color: #0056b3;
}

/* Botoes especiais */
.btn-desativado, .btn-desativado-transferencia,
.btn:disabled, button:disabled {
    background-color: var(--secondary);
    border-color: var(--secondary);
    color: white;
    opacity: 0.65;
    pointer-events: none;
}

/* Navbar Mobile */
@media (max-width: 767.98px) {
    .header-dots button {
        padding: 0.25rem !important;
    }
    
    .widget-content-left .btn-group .dropdown-menu {
        left: auto;
        right: 0;
    }
}

/* Chat Icon */
.fa-comment, .fa-comment-o {
    color: var(--primary);
}

/* Reset de alguns estilos da base */
.app-header {
    display: none !important;
}

.app-main {
    margin-top: 0 !important;
}

/* Scrollbar lateral */
.app-sidebar .scrollbar-sidebar {
    height: 100vh;
    overflow-y: auto;
}

.app-sidebar .scrollbar-sidebar::-webkit-scrollbar {
    width: 5px;
}

.app-sidebar .scrollbar-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.2);
    border-radius: 10px;
}

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

/* Estilos dos menus laterais */
.app-sidebar__heading {
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: bold;
    margin: 1.5rem 0 0.5rem;
    padding: 0 1.5rem;
}

.vertical-nav-menu {
    padding: 0;
    margin: 0;
    list-style: none;
}

.vertical-nav-menu li a {
    display: block;
    line-height: 2.2rem;
    height: 2.2rem;
    padding: 0 1.5rem 0 1.5rem;
    position: relative;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: none;
    white-space: nowrap;
    transition: all .2s;
}

.vertical-nav-menu li a:hover {
    background: rgba(0, 123, 255, 0.05);
    color: var(--sidebar-text);
}

.vertical-nav-menu li a i {
    width: 1.5rem;
    display: inline-block;
    text-align: center;
    margin-right: 0.5rem;
    font-size: 1rem;
    opacity: 0.9;
}

.vertical-nav-menu li ul {
    padding: 0;
    margin: 0;
    list-style: none;
    overflow: hidden;
    background: rgba(0,0,0,0.15);
}

.vertical-nav-menu li ul li a {
    padding-left: 3rem;
    height: 2rem;
    line-height: 2rem;
    font-size: 0.8rem;
}

/* Sidebar Accordion Styles */
.app-sidebar .accordion-item {
    background-color: transparent;
    border: none;
}

.app-sidebar .accordion-header {
    margin-bottom: 0;
}

.app-sidebar .accordion-button {
    background-color: transparent;
    color: rgba(255,255,255,0.8);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 1rem 1.5rem;
    border: none;
    box-shadow: none;
    width: 100%;
    text-align: left;
}

.app-sidebar .accordion-button:not(.collapsed) {
    color: #ffffff;
    background-color: rgba(241, 134, 34, 0.1);
}

.app-sidebar .accordion-button:focus {
    box-shadow: none;
    border: none;
}

.app-sidebar .accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    transition: transform .2s ease-in-out;
}

.app-sidebar .accordion-body {
    padding: 0;
}

/* Production Theme Styles for Accordion */
.app-sidebar.sidebar-prod .accordion-button {
    color: #23272b;
}

.app-sidebar.sidebar-prod .accordion-button:not(.collapsed) {
    color: var(--primary);
    background-color: rgba(241, 134, 34, 0.05);
}

.app-sidebar.sidebar-prod .accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2323272b'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* Responsividade */
@media (max-width: 991.98px) {
    .app-main__outer {
        padding-left: 0 !important;
    }
    
    .app-sidebar {
        transform: translateX(-280px);
        transition: transform 0.3s ease;
    }
    
    .app-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .app-sidebar-toggle {
        display: flex;
    }
}

/* Páginas */
.app-page-title {
    padding: 10px 0 15px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #e9e9e9;
}

.app-page-title .page-title-wrapper {
    display: flex;
    align-items: center;
}

.app-page-title .page-title-icon {
    font-size: 1.5rem;
    margin-right: 10px;
    color: var(--primary) !important;
}

.app-page-title .page-title {
    font-size: 1.35rem;
    margin: 0;
    color: #343a40;
    font-weight: 500;
}

.app-page-title small.text-muted {
    font-weight: 400;
    font-size: 0.9rem;
}

/* Footer fixo na parte inferior */
.app-wrapper-footer {
    border-top: 1px solid rgba(0,0,0,0.1);
    margin-top: auto;
    width: 100%;
}

.app-footer {
    padding: 1rem 1.5rem;
}

.app-footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-footer-left, .app-footer-right {
    color: #6c757d;
    font-size: 0.85rem;
}

/* Estilo aprimorado de formulários */
.form-control {
    height: auto;
    padding: 0.6rem 1rem;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
    border: 1px solid #ced4da;
    font-size: 1rem;
    line-height: 1.5;
    box-shadow: none;
    color: var(--text-primary);
}

label {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Melhorias nos Cards */
.card {
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.07);
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    background-color: #ffffff;
}

.card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.07);
}

.card-header {
    padding: 0.75rem 1.25rem;
    margin-bottom: 0;
    background-color: rgba(0,0,0,.03);
    border-bottom: 1px solid rgba(0,0,0,.125);
    border-top-left-radius: calc(0.375rem - 1px);
    border-top-right-radius: calc(0.375rem - 1px);
}

.card-title {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0;
}

.card-body {
    padding: 1.75rem 1.5rem;
    background-color: #ffffff;
}

.list-group-item {
    border-color: rgba(0, 0, 0, 0.05);
}

/* Estilo aprimorado de botões */
.btn {
    display: inline-block;
    font-weight: 400;
    color: var(--text-primary);
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    box-shadow: none;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn:hover {
    filter: brightness(90%);
}

.btn:active {
    filter: brightness(80%);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
}

.btn-secondary {
    background-color: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
}
.btn-secondary:hover {
    background-color: #545b62;
    border-color: #4e555b;
    color: #fff;
    filter: brightness(100%);
}

.btn-success {
    background-color: var(--success);
    border-color: var(--success);
    color: #fff;
}
.btn-success:hover {
    background-color: #1e7e34;
    border-color: #1c7430;
    color: #fff !important;
    filter: brightness(100%);
}

.btn-danger {
    background-color: var(--danger) !important;
    border-color: var(--danger) !important;
    color: #fff !important;
}
.btn-danger:hover {
    background-color: #bd2130 !important;
    border-color: #b21f2d !important;
    color: #fff !important;
    filter: brightness(100%);
}

.btn-warning {
    background-color: var(--warning);
    border-color: var(--warning);
    color: var(--dark);
}
.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
    color: var(--dark);
    filter: brightness(100%);
}

.btn-info {
    background-color: var(--info);
    border-color: var(--info);
    color: #fff;
}
.btn-info:hover {
    background-color: #117a8b;
    border-color: #10707f;
    color: #fff;
    filter: brightness(100%);
}

.btn-light {
    background-color: var(--light);
    border-color: var(--light);
    color: var(--dark);
}
.btn-light:hover {
    background-color: #dae0e5;
    border-color: #d3d9df;
    color: var(--dark);
    filter: brightness(100%);
}

.btn-dark {
    background-color: var(--dark);
    border-color: var(--dark);
    color: #fff;
}
.btn-dark:hover {
    background-color: #1d2124;
    border-color: #171a1d;
    color: #fff;
    filter: brightness(100%);
}

/* Outline Buttons */
.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
    filter: brightness(100%);
}
.btn-outline-secondary {
    color: var(--secondary);
    border-color: var(--secondary);
}
.btn-outline-secondary:hover {
    color: #fff;
    background-color: var(--secondary);
    border-color: var(--secondary);
    filter: brightness(100%);
}

/* Espaçamentos e margens */
.ml-2 {
    margin-left: 0.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

/* Responsividade para formulários */
@media (max-width: 767.98px) {
    .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .ml-2 {
        margin-left: 0 !important;
    }
}

/* Ajuste de containers */
.container, .container-fluid {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
    box-sizing: border-box;
}

/* Global Box-Sizing Fix */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Additional Dashboard Styles */
.card {
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.07);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    background-color: #ffffff;
}

.card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.07);
}

.card-header {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.list-group-item {
    border-color: rgba(0, 0, 0, 0.05);
}

/* Improved button styles for eye icons */
.btn.rounded-circle {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* System info cards improvement */
.card.bg-primary, .card.bg-success, .card.bg-info {
    border-radius: 8px;
    overflow: hidden;
}

.card.bg-primary .card-body, .card.bg-success .card-body, .card.bg-info .card-body {
    padding: 1.25rem;
}

.opacity-50 {
    opacity: 0.6;
}

/* Improve mobile view */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .card.bg-primary, .card.bg-success, .card.bg-info {
        margin-bottom: 1rem;
    }
}

/* Correção para o texto do cabeçalho da tabela */
.table thead.bg-primary th {
    color: #212529 !important;
}

.bg-primary {
    background-color: var(--we-digital-orange) !important;
}

/* Ajuste de contraste para cabeçalhos de tabela */
.table thead.bg-primary {
    background-color: #f8f9fa !important;
}

.table thead.bg-primary th {
    color: #212529 !important;
    font-weight: 600;
    border-color: #dee2e6;
}

/* Sobrescrever cores padrão de .bg-primary nas tabelas */
.table .bg-primary {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

/* Sobrescrever .text-white nas tabelas */
.table .text-white {
    color: #212529 !important;
}

/* Preservar cores em badges */
.badge.bg-success,
.badge.bg-danger,
.badge.bg-info,
.badge.bg-secondary {
    color: white !important;
}

/* Preservar cores em botões */
.table .btn-primary {
    background-color: var(--we-digital-orange) !important;
    color: white !important;
}

/* Preservar cores em botões secundários */
.table .btn-secondary {
    background-color: #6c757d !important;
    color: white !important;
}

/* Correções adicionais para tabelas nas páginas de conversas e logs */

/* Garantir que o texto nas linhas da tabela seja visível */
.table tbody tr,
.table tbody tr td {
    color: #212529 !important;
}

/* Garantir contraste adequado para links e botões dentro das tabelas */
.table a, 
.table .btn {
    color: inherit;
}

.table .btn-primary {
    color: white !important;
}

/* Correção para tabelas responsivas */
.table-responsive .table {
    color: #212529 !important;
}

/* Ensure Bootstrap 5 .btn-close displays its icon */
.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: .25em .25em;
    color: #000;
    background: transparent var(--bs-btn-close-bg, url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e")) center/1em auto no-repeat;
    border: 0;
    border-radius: .25rem;
    opacity: .5;
}

.btn-close:hover {
    color: #000;
    text-decoration: none;
    opacity: .75;
}

.btn-close:focus {
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(241, 134, 34, 0.25); /* Using --focus color */
    opacity: 1;
}

.btn-close:disabled, .btn-close.disabled {
    pointer-events: none;
    user-select: none;
    opacity: .25;
}

/* Styles for JSON Formatter in Log View */
.json-container {
    position: relative;
    background-color: #2B303B; /* Dark background - Adjust as per We Digital dark theme */
    color: #C0C5CE; /* Light text for dark background */
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    line-height: 1.6;
    overflow-x: auto;
    margin-top: 10px;
}

.json-viewer {
    white-space: pre;
}

.json-key {
    color: #EC5f67; /* Example: We Digital Orange or a contrasting color */
}

.json-string {
    color: #99C794; /* Example: Greenish */
}

.json-number {
    color: #FAC863; /* Example: Yellowish */
}

.json-boolean {
    color: #C594C5; /* Example: Purplish */
}

.json-null {
    color: #AB7967; /* Example: Brownish */
}

.json-bracket,
.json-punctuation {
    color: #65737E; /* Example: Greyish */
}

.json-copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--we-digital-orange); /* We Digital Orange */
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
}

.json-copy-button:hover {
    background-color: #d76f17; /* Darker orange */
}

.bg-primary-light {
    background-color: #fef3e9 !important; /* Light shade of #F18622 */
    padding: 0.5rem;
    border-radius: 0.25rem;
} 