/**
 * Estilos personalizados para o sistema
 * WebCis Apps - Sistema de Controle de Produtos
 *
 * @version 1.0
 * @date 26/08/2025
 */

:root {
    --primary-color: #1e3a8a;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --light-color: #f3f4f6;
    --dark-color: #111827;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 80px;
    --header-height: 60px;
    --footer-height: 50px;
    /* --bs-border-color: #999c9e !important; */
    --bs-border-width: 2px !important;
}

/* Estilos Gerais */
body {
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    background-color: #ececec;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--info-color);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #2a4caf;
    border-color: #2a4caf;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

/* Layout do Sidebar */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

#sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 999;
    background: var(--dark-color);
    color: #fff;
    transition: all 0.3s;
}

#sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

#sidebar .sidebar-header {
    padding: 15px;
    background: rgba(0, 0, 0, 0.1);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar .sidebar-header h3 {
    font-size: 1.2rem;
    margin-top: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#sidebar.collapsed .sidebar-header h3 {
    display: none;
}

.sidebar-logo {
    width: 200px;
    height: auto;
    margin-bottom: 15px;
    margin-top: 10px;
}

#sidebar ul.components {
    padding: 10px 0;
}

#sidebar ul li {
    position: relative;
}

#sidebar ul li a {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    border-left: 3px solid transparent;
}

#sidebar ul li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--info-color);
}

#sidebar ul li.active > a {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--info-color);
}

#sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

#sidebar.collapsed ul li a span {
    display: none;
}

#sidebar ul ul.collapse {
    background: rgba(0, 0, 0, 0.2);
}

#sidebar ul ul li a {
    padding-left: 45px;
    font-size: 0.9rem;
}

/* Conteúdo da página */
#content {
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    transition: all 0.3s;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 0;
    flex: 1 1 auto;
    overflow-x: hidden;
}

#content.active {
    width: calc(100% - var(--sidebar-collapsed-width));
    margin-left: var(--sidebar-collapsed-width);
}

/* Navbar */
.navbar {
    padding: 10px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 600;
}

.avatar-mini {
    width: 30px;
    height: 30px;
    object-fit: cover;
}

/* Footer */
.footer {
    padding: 15px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: auto;
    background: #fff;
    width: 100%;
    position: relative;
    clear: both;


}

.footer     p{
        padding: 10px
    }

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #ffffff;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-bottom: none;
    background-color: transparent;
    padding: 20px 20px 0 20px;
    font-weight: 600;
}

.card-body {
    padding: 22px !important;
}

/* Melhorias no espaçamento do dashboard */
.dashboard-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.dashboard-card .card-subtitle {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

/* Estatísticas Dashboard */
.stats-card {
    padding: 20px;
}

.stats-card .icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 15px;
}

.stats-card .stats-title {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

/* Ícones nos cards do dashboard */
.stat-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5rem;
    margin-right: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 0;
}

.bg-primary.stat-icon {
    background-color: rgba(30, 58, 138, 0.9) !important;
}

.bg-success.stat-icon {
    background-color: rgba(16, 185, 129, 0.9) !important;
}

.bg-warning.stat-icon {
    background-color: rgba(245, 158, 11, 0.9) !important;
}

.bg-info.stat-icon {
    background-color: rgba(59, 130, 246, 0.9) !important;
}

.bg-danger.stat-icon {
    background-color: rgba(239, 68, 68, 0.9) !important;
}

/* Melhoria nos badges */
.badge {
    padding: 0.5rem 0.7rem;
    font-weight: 500;
    font-size: 0.8rem;
}

.bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.15) !important;
}

.bg-danger-subtle {
    background-color: rgba(239, 68, 68, 0.15) !important;
}

.bg-warning-subtle {
    background-color: rgba(245, 158, 11, 0.15) !important;
}

.bg-info-subtle {
    background-color: rgba(59, 130, 246, 0.15) !important;
}

/* Estilos para os ícones dos cards do dashboard */
.card .stat-icon i {
    font-size: 1.8rem;
}

/* Cores dos ícones de indicadores */
.dashboard-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    margin-right: 15px;
    font-size: 1.5rem;
}

.dashboard-icon-primary {
    background-color: #EBF3FF;
    color: var(--primary-color);
}

.dashboard-icon-success {
    background-color: #E6F8F3;
    color: var(--success-color);
}

.dashboard-icon-warning {
    background-color: #FFF8E6;
    color: var(--warning-color);
}

.dashboard-icon-info {
    background-color: #E6F0FF;
    color: var(--info-color);
}

/* Estilos específicos para os cards indicadores do dashboard */
.indicator-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.indicator-icon i {
    font-size: 22px;
}

.produtos-icon {
    background-color: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.vendas-icon {
    background-color: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.estoque-icon {
    background-color: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.busca-icon {
    background-color: rgba(99, 102, 241, 0.15);
    color: #4f46e5;
}

/* Estilos para tendências e tags */
.tag-tendencia {
    background-color: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.tag-tendencia i {
    margin-right: 4px;
}

/* Estilos para números no dashboard */
.indicator-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark-color);
    margin: 10px 0;
}

.indicator-label {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 0;
}

/* Melhorar espaçamento entre cards */
.dashboard-row {
    margin-bottom: 1.5rem;
}

/* Reposição necessária tag */
.reposicao-tag {
    background-color: rgba(245, 158, 11, 0.15);
    color: #d97706;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.stats-card .stats-value {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0;
}

.stats-card .stats-change {
    font-size: 0.8rem;
}

.stats-card .stats-change.positive {
    color: var(--success-color);
}

.stats-card .stats-change.negative {
    color: var(--danger-color);
}

/* Formulários */
.form-control:focus {
    box-shadow: none;
    border-color: var(--primary-color);
}

.form-label {
    font-weight: 500;
    margin-bottom: 5px;
}

.input-group-text {
    background-color: var(--light-color);
    border-color: var(--bs-border-color);
}

/* Tabelas */
.table-responsive {
    border-radius: 10px;
    overflow-x: clip;
}

.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    background-color: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.table .actions {
    display: flex;
    gap: 5px;
}

/* Botões de ação nas tabelas */
.btn-action {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
}

/* Badges */
.badge {
    padding: 5px 10px;
    font-weight: normal;
    border-radius: 50px;
}

/* Status de vendas */
.status-badge {
    padding: 5px 10px;
    border-radius: 50px;
    font-size: 0.8rem;
}

.status-pendente {
    background-color: #fef3c7;
    color: #92400e;
}

.status-enviado {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-entregue {
    background-color: #d1fae5;
    color: #065f46;
}

.status-cancelado {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Página de Login/Recuperação */
.public-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
    padding: 20px;
}

.public-header {
    text-align: center;
    margin-bottom: 30px;
}

.public-logo {
    width: 100px;
    margin-bottom: 20px;
}

.login-form, .recovery-form {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

/* Imagens de produtos */
.product-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 1px solid #dee2e6;
    transition: transform 0.2s ease;
}

.product-thumbnail:hover {
    transform: scale(1.1);
}

.product-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    padding-bottom: 20px;
}

.product-detail-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Tooltip personalizado para produtos */
.product-tooltip {
    max-width: 250px;
}

.product-tooltip-image {
    border-radius: 5px;
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
}

.product-tooltip-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.product-tooltip-code {
    color: #64748b;
}

.product-tooltip-price {
    font-weight: 600;
    color: var(--primary-color);
}

/* Responsividade */
@media (max-width: 768px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }

    #sidebar.active {
        margin-left: 0;
    }

    #content {
        width: 100%;
    }

    #content.active {
        width: 100%;
    }

    #sidebarCollapse span {
        display: none;
    }

    .card-deck {
        display: block;
    }
}

/* Animações */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Upload de Imagem */
.image-upload-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.image-preview {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: contain;
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 5px;
    background-color: #f8f9fa;
}

.image-upload-input {
    display: none;
}

.image-upload-label {
    display: block;
    background-color: var(--primary-color);
    color: white;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.image-upload-label:hover {
    background-color: #2a4caf;
}

/* Croppper customização */
.cropper-container {
    margin: 0 auto;
}

/* Estilos para filtro de histórico de estoque */
.filtro-historico .form-control {
    width: 100%;
    height: calc(2.25rem);
}

.filtro-historico .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.filtro-historico .select2-container {
    width: 100% !important;
}

/* Ajusta alinhamento vertical dos elementos do formulário */
.filtro-historico .row.align-items-end {
    align-items: flex-end !important;
}

/* Torna os botões de filtro mais alinhados com campos */
.filtro-historico .btn {
    padding: 0.375rem 0.75rem;
    line-height: 1.5;
}

/* Responsividade para o filtro */
@media (max-width: 767.98px) {
    .filtro-historico .btn {
        width: 100%;
        margin-right: 0 !important;
        margin-bottom: 0.5rem;
    }
}

.card-img, .card-img-bottom, .card-img-top{
    height: 300px;
    object-fit: cover;
}

.thumb-img{
    height: 90px;
    object-fit: cover;
}

.info-esgotado{
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    padding: 5px 10px;
}

.ql-container{
    height: 73% !important;
}

.no-image{
    text-align: center;
}

.product-badge{
    color: #fff;
    width: fit-content;
    padding: 3px 5px;
    border-radius: 8px;
    margin: 0 auto;
}
