/* Portal Lojista - CSS customizado replicando o estilo PHP */

/* Variáveis CSS para cores consistentes - Paleta Azul WallClub (mais escura) */
:root {
    --primary-gradient: linear-gradient(135deg, #0f2a5a 0%, #1a4480 100%);
    --primary-hover-gradient: linear-gradient(135deg, #0d2348 0%, #153a6e 100%);
    --primary-color: #1a4480;
    --primary-dark: #0f2a5a;
    --success-gradient: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    --warning-gradient: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    --danger-gradient: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    --info-gradient: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
    
    --shadow-light: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-heavy: 0 8px 15px rgba(0,0,0,0.2);
    
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 20px;
}

/* Reset e configurações base */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Sidebar Desktop (telas grandes) */
.sidebar-desktop {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--primary-gradient);
    box-shadow: var(--shadow-heavy);
    overflow-y: auto;
    z-index: 1040;
    padding: 0;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-header h4 {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0;
}

.sidebar-desktop .nav {
    padding: 15px 10px;
}

/* Navbar mobile customizada */
.navbar {
    background: var(--primary-gradient);
    box-shadow: var(--shadow-medium);
    border: none;
}

.navbar-mobile {
    z-index: 1030;
}

.navbar-brand img {
    height: 40px;
    width: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

/* Offcanvas menu lateral */
.offcanvas {
    background: var(--primary-gradient);
    border: none;
}

.offcanvas-header {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem;
}

.offcanvas-title {
    font-weight: 600;
    font-size: 1.25rem;
}

.offcanvas-body {
    padding: 1rem;
}

/* Navegação lateral */
.nav-link {
    color: rgba(255,255,255,0.9) !important;
    padding: 12px 20px !important;
    border-radius: var(--border-radius);
    margin: 3px 0;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(255,255,255,0.2);
    color: white !important;
    transform: translateX(5px);
    box-shadow: var(--shadow-light);
}

.nav-link i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.logout-link {
    color: #ff6b6b !important;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 15px;
    padding-top: 15px;
}

.logout-link:hover {
    background-color: rgba(255,107,107,0.2);
    transform: translateX(5px);
}

/* Conteúdo principal */
.main-content {
    padding: 20px;
    min-height: 100vh;
}

/* Desktop: margem para sidebar fixa */
@media (min-width: 992px) {
    .main-content {
        margin-left: 260px;
        margin-top: 0;
    }
}

/* Mobile: margem para navbar fixa */
@media (max-width: 991px) {
    .main-content {
        margin-top: 70px;
        margin-left: 0;
    }
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
    background: white;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.card-header {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    font-weight: 600;
}

/* Botões */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 10px 20px;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
}

.btn-primary:hover {
    background: var(--primary-hover-gradient);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-success, .btn-search {
    background: var(--success-gradient);
    border: none;
    color: white;
}

.btn-success:hover, .btn-search:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    color: white;
    transform: translateY(-1px);
}

.btn-warning, .btn-export {
    background: var(--warning-gradient);
    border: none;
    color: white;
}

.btn-warning:hover, .btn-export:hover {
    background: linear-gradient(135deg, #e0a800 0%, #e8650e 100%);
    color: white;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-gradient);
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #dc1a7a 100%);
    transform: translateY(-1px);
}

.btn-info {
    background: var(--info-gradient);
    border: none;
}

.btn-info:hover {
    background: linear-gradient(135deg, #138496 0%, #5a2d91 100%);
    transform: translateY(-1px);
}

/* Formulários */
.form-control, .form-select {
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 12px 15px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(42, 82, 152, 0.25);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

/* Tabelas */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.table thead th {
    background: var(--primary-gradient);
    color: white;
    border: none;
    font-weight: 600;
    padding: 15px 10px;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(42, 82, 152, 0.05);
}

.smaller-font {
    font-size: 0.875rem;
}

/* Cards de totais */
.card.bg-primary {
    background: var(--primary-gradient) !important;
}

.card.bg-success {
    background: var(--success-gradient) !important;
}

.card.bg-warning {
    background: var(--warning-gradient) !important;
}

.card.bg-info {
    background: var(--info-gradient) !important;
}

.card.bg-danger {
    background: var(--danger-gradient) !important;
}

/* Alertas */
.alert {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.alert-dismissible .btn-close {
    padding: 0.75rem 1rem;
}

/* Filtros */
.filter-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-medium);
    border-left: 4px solid var(--primary-color);
}

.results-container {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-medium);
}

/* Loading animation */
.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.5em 0.75em;
    border-radius: var(--border-radius);
}

/* Responsividade */
@media (max-width: 768px) {
    .main-content {
        padding: 15px 10px;
    }
    
    .filter-card, .results-container {
        padding: 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand img {
        height: 35px;
    }
    
    .main-content {
        margin-top: 60px;
        padding: 10px 5px;
    }
    
    .offcanvas-body {
        padding: 0.5rem;
    }
    
    .nav-link {
        padding: 10px 15px !important;
        font-size: 0.9rem;
    }
}

/* Animações suaves */
* {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

/* Scrollbar customizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover-gradient);
}

/* Utilitários */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.shadow-custom {
    box-shadow: var(--shadow-medium);
}

.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box, var(--primary-gradient) border-box;
}

/* ===== PÁGINA DE LOGIN ===== */
.login-page {
    background: var(--primary-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.login-container {
    background: white;
    border-radius: var(--border-radius-xl);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
}

.login-header {
    background: var(--primary-gradient);
    color: white;
    padding: 30px;
    text-align: center;
}

.login-header img {
    height: 60px;
    margin-bottom: 15px;
    border-radius: 8px;
}

.login-body {
    padding: 40px 30px;
}

.login-body .form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.login-body .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(42, 82, 152, 0.25);
}

.btn-login {
    background: var(--primary-gradient);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    width: 100%;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: var(--primary-hover-gradient);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(42, 82, 152, 0.4);
    color: white;
}

.login-body .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.login-body .mb-3 {
    margin-bottom: 1.5rem;
}

.login-body .alert {
    border-radius: 10px;
    border: none;
}

.forgot-password {
    text-align: center;
    margin-top: 20px;
}

.forgot-password a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/* ===== PÁGINA DE ACEITE ===== */
.terms-content {
    height: 400px;
    overflow-y: scroll;
    border: 1px solid #dee2e6;
    padding: 20px;
    border-radius: var(--border-radius);
    background-color: #f8f9fa;
}

.terms-content h5, .terms-content h6 {
    color: var(--primary-dark);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.terms-content h5:first-child {
    margin-top: 0;
}

.terms-content p {
    text-align: justify;
    line-height: 1.6;
    margin-bottom: 1rem;
}

#submit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

#aceito:disabled + label {
    color: #6c757d;
    cursor: not-allowed;
}

/* ===== CORREÇÕES DE Z-INDEX ===== */

/* Offcanvas menu lateral - z-index mais alto */
.offcanvas {
    z-index: 1055 !important;
}

/* Botões de pesquisa - z-index menor que o menu lateral */
.btn-search, .btn-export {
    position: relative;
    z-index: 1040 !important;
}

/* Dropdown de exportação - z-index controlado */
.btn-group .dropdown-menu {
    z-index: 1050 !important;
    position: absolute !important;
}

/* Tabelas - z-index baixo para não interferir */
.table-responsive {
    position: relative;
    z-index: 1 !important;
}

/* Navbar - z-index padrão do Bootstrap */
.navbar {
    z-index: 1030 !important;
}

/* Cards de resultados - z-index baixo */
.card {
    position: relative;
    z-index: 1 !important;
}

/* Modais - z-index mais alto */
.modal {
    z-index: 1060 !important;
}

/* Tooltips e popovers */
.tooltip {
    z-index: 1070 !important;
}

.popover {
    z-index: 1070 !important;
}

/* ===== DASHBOARD CARDS (COPIADO DO PORTAL ADMIN) ===== */
.stats-card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
    min-height: 150px;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(101, 201, 122, 0.15);
}

.stats-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
}

.stats-label {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.stats-icon {
    font-size: 3.5rem;
    opacity: 0.8;
}

.stats-card-hoje { border-left-color: #28a745; }
.stats-card-mes { border-left-color: #007bff; }
.stats-card-valor-hoje { border-left-color: #ffc107; }
.stats-card-valor-mes { border-left-color: #17a2b8; }

/* ===== PAGE HEADER COMPACT ===== */
.page-header-compact {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 20px 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-medium);
    border-left: 4px solid var(--primary-color);
}

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.page-title i {
    margin-right: 10px;
    color: var(--primary-color);
}

.page-subtitle {
    color: #6c757d;
    font-size: 0.95rem;
    font-weight: 400;
}

/* Responsividade para page-header-compact */
@media (max-width: 768px) {
    .page-header-compact {
        padding: 15px 20px;
        margin-bottom: 15px;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .page-subtitle {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .page-header-compact {
        padding: 12px 15px;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .page-title i {
        margin-right: 8px;
    }
}

/* ===== CLASSES DE AUTENTICAÇÃO (USANDO PADRÃO DE LOGIN) ===== */
body.auth-body {
    background: var(--primary-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.auth-container {
    background: white;
    border-radius: var(--border-radius-xl);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
    max-width: 500px;
}

.auth-header {
    background: var(--primary-gradient);
    color: white;
    padding: 30px;
    text-align: center;
}

.wallclub-logo {
    background: rgba(255,255,255,0.2);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    backdrop-filter: blur(10px);
}

.wallclub-logo i {
    font-size: 2.5rem;
    color: white;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: white;
}

.auth-header p {
    margin-bottom: 0;
    opacity: 0.75;
    color: rgba(255,255,255,0.75);
}

.auth-body {
    padding: 40px 30px;
}

.auth-body .form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.auth-body .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(42, 82, 152, 0.25);
}

.auth-body .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.auth-body .form-label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.auth-body .btn-primary {
    background: var(--primary-gradient);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    width: 100%;
    transition: all 0.3s ease;
}

.auth-body .btn-primary:hover {
    background: var(--primary-hover-gradient);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(42, 82, 152, 0.4);
    color: white;
}

.auth-body .form-text {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    margin-top: 8px;
}

.auth-body .text-muted {
    color: #6c757d !important;
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-body .mb-3 {
    margin-bottom: 1.5rem;
}

.auth-body .mb-4 {
    margin-bottom: 2rem;
}

.auth-body .alert {
    border-radius: 10px;
    border: none;
}

/* Responsividade para autenticação */
@media (max-width: 768px) {
    .auth-container {
        margin: 20px;
        max-width: calc(100% - 40px);
    }
    
    .auth-header {
        padding: 25px 20px;
    }
    
    .auth-header h1 {
        font-size: 1.3rem;
    }
    
    .auth-body {
        padding: 30px 20px;
    }
}

@media (max-width: 576px) {
    .auth-container {
        margin: 15px;
        max-width: calc(100% - 30px);
    }
    
    .auth-header {
        padding: 20px 15px;
    }
    
    .auth-header h1 {
        font-size: 1.2rem;
    }
    
    .auth-body {
        padding: 25px 15px;
    }
    
    .auth-body .form-control {
        padding: 10px 12px;
        font-size: 15px;
    }
    
    .auth-body .btn-primary {
        padding: 10px;
        font-size: 15px;
    }
}

/* ===== ESTILOS DE TABELAS PADRONIZADAS ===== */
.table th {
    background-color: #343a40 !important;
    color: white !important;
    font-size: 0.85rem;
    padding: 12px 8px;
    vertical-align: middle;
}

.table td {
    font-size: 0.80rem;
    padding: 10px 8px;
    vertical-align: middle;
}

.table .badge {
    font-size: 0.75rem;
}

.card-header h4 {
    font-size: 1.1rem;
}

.btn-group .btn {
    padding: 0.25rem 0.5rem;
}
