/**
 * Design System e Estilização Customizada do Projeto Carne
 * Cores Centralizadas: Mude as variáveis abaixo e o tema mudará por completo.
 */

:root {
    /* DUAS CORES CENTRAIS (Editáveis) */
    --primary-color: #41403f;
    /* Tom Escuro (ex: Azul Petróleo) */
    --secondary-color: #eeea17;
    /* Tom de Destaque (ex: Vermelho Coral) */

    /* Variáveis de suporte baseadas nas duas cores */
    --primary-light: rgba(44, 62, 80, 0.08);
    --primary-hover: #1a252f;
    --secondary-light: rgba(231, 76, 60, 0.12);
    --secondary-hover: #c0392b;

    /* Cores neutras complementares */
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --text-dark: #2d3748;
    --text-muted: #718096;

    /* Outras configurações */
    --sidebar-width: 260px;
    --transition-speed: 0.3s;
    --border-radius: 12px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Configurações Gerais */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Botões Customizados Baseados nas Cores Centrais */
.btn-primary-custom,
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: var(--bg-white) !important;
    border-radius: 8px;
    padding: 10px 20px;
    transition: all var(--transition-speed) ease;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08) !important;
}

.btn-primary-custom:hover,
.btn-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: var(--bg-white) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

#btn-novo-cliente,
#btn-emitir-carne,
#btn-imprimir-capa-global,
#btn-novo-cliente:hover,
#btn-emitir-carne:hover,
#btn-imprimir-capa-global:hover {
    color: var(--secondary-color) !important;
}

#btn-imprimir-capa-global,
#btn-emitir-carne {
    min-width: 260px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary-custom,
.btn-secondary {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: var(--bg-white) !important;
    border-radius: 8px;
    padding: 10px 20px;
    transition: all var(--transition-speed) ease;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08) !important;
}

.btn-secondary-custom:hover,
.btn-secondary:hover {
    background-color: var(--secondary-hover) !important;
    border-color: var(--secondary-hover) !important;
    color: var(--bg-white) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

/* Botões de Ação de Tabela (Outline) */
.btn-outline-primary,
.btn-outline-info {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    background-color: transparent !important;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
}

.btn-outline-primary:hover,
.btn-outline-info:hover {
    background-color: var(--primary-color) !important;
    color: var(--bg-white) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

.btn-outline-danger {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    background-color: transparent !important;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
}

.btn-outline-danger:hover {
    background-color: #dc3545 !important;
    color: var(--bg-white) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Layout de Sidebar e Conteúdo Principal */
#wrapper {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
#sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: var(--bg-white);
    flex-shrink: 0;
    transition: all var(--transition-speed) ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    height: auto;
    padding: 15px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--bg-white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 24px;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
    border-left: 4px solid transparent;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    color: var(--secondary-color);
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-menu li.active a {
    border-left-color: var(--secondary-color);
    background-color: rgba(255, 255, 255, 0.12);
}

.sidebar-menu li a i {
    color: var(--secondary-color);
}

.sidebar-menu li a.sidebar-logout {
    color: var(--secondary-color) !important;
}

.sidebar-menu li a.sidebar-logout i {
    color: var(--secondary-color) !important;
}

.sidebar-border-top {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Conteúdo Principal */
#main-content {
    flex-grow: 1;
    overflow: hidden;
    background-color: #fefce8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M10 20h40v20H10z' fill='none' stroke='rgba(238, 234, 23, 0.08)' stroke-width='1.5'/%3E%3Ccircle cx='30' cy='30' r='6' fill='none' stroke='rgba(238, 234, 23, 0.08)' stroke-width='1.5'/%3E%3Cpath d='M15 25l3 3m27-3l-3 3M15 35l3-3m27 3l-3-3' stroke='rgba(238, 234, 23, 0.08)' stroke-width='1.5'/%3E%3C/svg%3E");
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Navbar de Topo (Responsivo) */
.top-navbar {
    position: relative;
    background-color: var(--primary-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 75px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 992px) {
    .top-navbar {
        display: none !important;
    }
}

#section-title {
    display: none !important;
}

.menu-toggle-btn {
    background: none;
    border: none;
    color: var(--bg-white);
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    /* Oculto no Desktop */
}

/* Área de Páginas */
.content-body {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Cards Premium */
.custom-card {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow);
    padding: 25px;
    margin-bottom: 25px;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.content-body .custom-card:last-child {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    margin-bottom: 0;
}

.custom-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

/* Estilização de Tabelas Premium */
.custom-table-container {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    flex-grow: 1;
    overflow-y: auto;
    min-height: 0;
    margin-top: 15px;
}

.custom-table {
    width: 100%;
    margin-bottom: 0;
    vertical-align: middle;
}

.custom-table thead th {
    background-color: var(--primary-color);
    color: var(--bg-white);
    position: sticky;
    top: 0;
    z-index: 1;
}

.custom-table thead th:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.custom-table th {
    text-align: center !important;
    font-weight: 600;
    padding: 16px 20px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: none;
}

.custom-table td {
    text-align: center !important;
    padding: 16px 20px;
    color: var(--text-dark);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.custom-table tbody tr:last-child td {
    border-bottom: none;
}

.custom-table tbody tr:hover {
    background-color: var(--primary-light);
}

/* Badges e Status */
.badge-custom-primary {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
}

.badge-custom-secondary {
    background-color: var(--secondary-light);
    color: var(--secondary-color);
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
}

.badge-custom-success {
    background-color: rgba(46, 204, 113, 0.15);
    color: #27ae60;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
}

.badge-custom-warning {
    background-color: rgba(241, 196, 15, 0.15);
    color: #d35400;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
}

/* Efeito de Destaque / Focus para inputs */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem var(--primary-light);
}

/* Responsividade Customizada */
@media (max-width: 991.98px) {

    /* No Tablet */
    .menu-toggle-btn {
        display: block;
        /* Exibe botão no Tablet */
    }
}

@media (max-width: 767.98px) {

    /* No Mobile */
    #sidebar {
        position: fixed;
        left: calc(-1 * var(--sidebar-width));
        top: 0;
        bottom: 0;
    }

    #sidebar.show {
        left: 0;
    }

    /* Overlay escuro quando a sidebar abre no mobile */
    #sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        transition: opacity var(--transition-speed) ease;
    }

    #sidebar-overlay.show {
        display: block;
    }

    .top-navbar {
        padding: 15px 20px;
    }

    .content-body {
        padding: 20px 15px;
    }

    .custom-table th,
    .custom-table td {
        padding: 12px 10px;
        font-size: 0.85rem;
    }
}

/* Transições Suaves para animações de carregamento de seções */
.fade-in-section {
    animation: fadeIn 0.4s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Unificar largura dos botões do SweetAlert2 */
.swal2-actions button.swal2-styled {
    width: 130px !important;
    justify-content: center;
}

.swal2-actions button.swal2-styled:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
    pointer-events: auto !important;
}

/* Card de busca com fundo da cor do tema */
.card-theme-bg {
    background-color: var(--primary-color) !important;
    border: none !important;
}

.card-theme-bg label {
    color: var(--bg-white) !important;
}

.card-theme-bg .input-group-text {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: var(--bg-white) !important;
}

.card-theme-bg .input-group-text i {
    color: var(--bg-white) !important;
}

.card-theme-bg input.form-control {
    background-color: var(--bg-white) !important;
    color: var(--text-dark) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.card-theme-bg input.form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25) !important;
}

/* Unificação dos botões de rodapé dos modais */
.modal-footer {
    display: flex;
    justify-content: center;
    /* Centraliza ou empurra conforme layout */
    gap: 10px;
}

.modal-footer .btn {
    width: 150px !important;
    height: 44px !important;
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08) !important;
    transition: all var(--transition-speed) ease !important;
}

.modal-footer .btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

/* Botão de Fechar do modal sempre Vermelho */
.modal-footer .btn-outline-secondary {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    background-color: transparent !important;
}

.modal-footer .btn-outline-secondary:hover {
    background-color: #dc3545 !important;
    color: var(--bg-white) !important;
}

/* Área de Texto Não Redimensionável */
.textarea-no-resize {
    resize: none;
}

/* Botões do Filtro de Histórico alinhados com inputs */
.btn-filter {
    height: 38px !important;
    padding: 0 15px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Badges do Setor no Histórico com largura igual */
.badge-setor {
    display: inline-block !important;
    width: 90px !important;
    text-align: center !important;
}

/* Coluna com ajuste de largura ao conteúdo */
.col-fit {
    width: 1% !important;
    white-space: nowrap !important;
}

/* ========================================================================= */
/* ESTILOS DA TELA DE LOGIN                                                  */
/* ========================================================================= */
.login-body-bg {
    background-color: #fefce8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M10 20h40v20H10z' fill='none' stroke='rgba(238, 234, 23, 0.08)' stroke-width='1.5'/%3E%3Ccircle cx='30' cy='30' r='6' fill='none' stroke='rgba(238, 234, 23, 0.08)' stroke-width='1.5'/%3E%3Cpath d='M15 25l3 3m27-3l-3 3M15 35l3-3m27 3l-3-3' stroke='rgba(238, 234, 23, 0.08)' stroke-width='1.5'/%3E%3C/svg%3E");
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    width: 100%;
    max-width: 850px;
    min-height: 460px;
    display: flex;
    flex-direction: row;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    background-color: var(--primary-color);
    color: #fff;
    padding: 45px;
    text-align: center;
    position: relative;
    flex: 0.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.login-header::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--secondary-color), var(--primary-color));
}

.login-brand {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.login-brand img {
    max-height: 180px;
    max-width: 100%;
    object-fit: contain;
    height: auto;
    width: auto;
}

.login-header p {
    margin-top: 15px !important;
    text-align: center;
}

.login-body {
    flex: 1.4;
    padding: 45px;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-body h4 {
    color: var(--primary-color);
}

.form-floating>.form-control:focus~label,
.form-floating>.form-control:not(:placeholder-shown)~label {
    color: var(--primary-color);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(44, 62, 80, 0.15);
}

.login-card .input-group-text {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: var(--secondary-color) !important;
}

.login-card .input-group-text:focus-within {
    border-color: var(--primary-color);
}

.alert-custom {
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group-text i,
.input-group-text .bi-funnel,
.input-group-text .bi-search,
i.bi-search,
i.bi-funnel {
    color: var(--secondary-color) !important;
}

/* Responsividade Login */
@media (max-width: 768px) {
    .login-card {
        flex-direction: column !important;
        max-width: 450px !important;
        min-height: auto !important;
    }
    .login-header::after {
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        height: 4px;
        width: auto;
        background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    }
}

.bg-subtle-yellow {
    background-color: #fefce8 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M10 20h40v20H10z' fill='none' stroke='rgba(238, 234, 23, 0.08)' stroke-width='1.5'/%3E%3Ccircle cx='30' cy='30' r='6' fill='none' stroke='rgba(238, 234, 23, 0.08)' stroke-width='1.5'/%3E%3Cpath d='M15 25l3 3m27-3l-3 3M15 35l3-3m27 3l-3-3' stroke='rgba(238, 234, 23, 0.08)' stroke-width='1.5'/%3E%3C/svg%3E") !important;
}

/* Customização de Foco do SweetAlert */
.swal2-input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(65, 64, 63, 0.25) !important;
}

/* Força as setas de subir/descer a estarem sempre visíveis nos inputs numéricos */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    opacity: 1 !important;
}

/* Botão de Histórico ao lado do Nome do Cliente no Crediário */
.btn-historico-cliente-inline {
    background: transparent;
    border: 1px solid rgba(65, 64, 63, 0.2);
    color: var(--primary-color);
    padding: 3px 7px;
    font-size: 0.8rem;
    border-radius: 6px;
    transition: all var(--transition-speed) ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    vertical-align: middle;
}

.btn-historico-cliente-inline:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* Modal de Conversas / Histórico do Cliente via SweetAlert2 */
.historico-swal-title {
    font-size: 1.15rem !important;
    font-weight: 600 !important;
    color: var(--primary-color) !important;
    padding: 1.25rem 1rem 0.5rem 1rem !important;
}

/* Botão Fechar em estilo Outline padrão */
.swal-btn-cancel-outline {
    background-color: transparent !important;
    border: 1px solid #dc3545 !important;
    color: #dc3545 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
    transition: all var(--transition-speed) ease !important;
}

.swal-btn-cancel-outline:hover {
    background-color: #dc3545 !important;
    color: var(--bg-white) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

/* Filtro por período dentro do modal (Padrão card escuro do sistema) */
.historico-filtro-datas {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--primary-color) !important;
    padding: 12px 14px;
    border-radius: var(--border-radius, 10px);
    border: none !important;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.historico-filtro-datas .filtro-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex: 1;
}

.historico-filtro-datas label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff !important;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.historico-filtro-datas input[type="date"] {
    width: 100%;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.95rem;
    font-weight: 400;
    background-color: #ffffff !important;
    color: #2d3748 !important;
    outline: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.historico-filtro-datas input[type="date"]:focus {
    border-color: #cbd5e1 !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25) !important;
}

.historico-chat-container {
    max-height: 280px;
    overflow-y: auto;
    padding: 10px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.historico-chat-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-align: left;
}

.historico-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.historico-chat-author {
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 4px;
}

.historico-chat-date {
    font-size: 0.72rem;
    color: #94a3b8;
}

.historico-chat-text {
    font-size: 0.88rem;
    color: var(--text-dark);
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

.historico-chat-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px dashed #f1f5f9;
}

.historico-chat-empty {
    text-align: center;
    color: #94a3b8;
    padding: 24px 10px;
    font-size: 0.88rem;
}

.historico-textarea-container {
    text-align: left;
}

.historico-textarea-container label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    display: block;
}

.historico-textarea-container textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.88rem;
    resize: none;
    outline: none;
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    background-color: #ffffff;
    font-family: inherit;
}

.historico-textarea-container textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(65, 64, 63, 0.2);
}

.cliente-nome-link {
    color: #1e293b;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease, opacity 0.2s ease;
    display: inline-block;
}

.cliente-nome-link:hover {
    color: #64748b !important;
    opacity: 0.85;
    text-decoration: underline;
}

/* ==========================================
   TELA DE INÍCIO (DASHBOARD)
   ========================================== */
.inicio-dashboard-container {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0;
    width: 100%;
}

.inicio-col-card {
    background: var(--primary-color);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.inicio-col-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.inicio-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.inicio-col-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.inicio-col-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.dashboard-stat-card {
    background: #2b2a29;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.dashboard-stat-card:hover {
    background: #333231;
    border-color: rgba(255, 255, 255, 0.2);
}

.dashboard-stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.dashboard-stat-card.card-pendente {
    background: #2e2b20;
    border-color: rgba(234, 179, 8, 0.25);
}
.dashboard-stat-card.card-pendente::before {
    background-color: #eab308;
}

.dashboard-stat-card.card-vencido {
    background: #312121;
    border-color: rgba(239, 68, 68, 0.25);
}
.dashboard-stat-card.card-vencido::before {
    background-color: #ef4444;
}

.dashboard-stat-card.card-pago {
    background: #1f2e24;
    border-color: rgba(34, 197, 94, 0.25);
}
.dashboard-stat-card.card-pago::before {
    background-color: #22c55e;
}

.dashboard-stat-card.card-total {
    background: #252423;
    border-color: rgba(238, 234, 23, 0.35);
}
.dashboard-stat-card.card-total::before {
    background-color: var(--secondary-color);
}

.dashboard-stat-info {
    display: flex;
    flex-direction: column;
}

.dashboard-stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dashboard-stat-value {
    font-size: 1.18rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}

.dashboard-stat-sub {
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 500;
}

.dashboard-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.icon-pendente {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
}

.icon-vencido {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.icon-pago {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.icon-total {
    background: rgba(238, 234, 23, 0.15);
    color: var(--secondary-color);
}