/* ============================================
   BELGA I.A - Layout EB Gateways Style
   Baseado no design do EB Gateways
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #dc3545;
    --primary-green: #28a745;
    --primary-purple: #6f42c1;
    --primary-blue: #007bff;
    --primary-orange: #fd7e14;
    --primary-gray: #6c757d;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-sidebar: #ffffff;
    --text-dark: #212529;
    --text-gray: #6c757d;
    --text-light: #adb5bd;
    --border-color: #dee2e6;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   CONTAINER PRINCIPAL
   ============================================ */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR ESQUERDA
   ============================================ */

.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-red);
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 14px;
    font-weight: 300;
    color: var(--text-gray);
}

.user-profile {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-large {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-red);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
    margin-bottom: 2px;
}

.user-role {
    font-size: 12px;
    color: var(--text-gray);
}

.balance-box {
    margin: 20px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.balance-label {
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.balance-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-green);
}

.sidebar-nav {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: var(--bg-light);
    border-left-color: var(--primary-red);
}

.nav-link.active {
    background: rgba(220, 53, 69, 0.1);
    border-left-color: var(--primary-red);
    color: var(--primary-red);
    font-weight: 600;
}

.nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-size: 14px;
}

.nav-section {
    margin-top: 10px;
}

.nav-section-title {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-gray);
    letter-spacing: 0.5px;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding: 10px 0;
}

.nav-link.logout {
    color: var(--primary-red);
}

.nav-link.logout:hover {
    background: rgba(220, 53, 69, 0.1);
}

/* ============================================
   CONTEÚDO PRINCIPAL
   ============================================ */

.main-content-wrapper {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    background: var(--bg-white);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-left {
    flex: 1;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-red);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-light);
    color: var(--text-dark);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--border-color);
    transform: scale(1.05);
}

.user-avatar-btn {
    background: var(--primary-red);
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.user-menu-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    display: none;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.user-menu-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
}

.content-area {
    flex: 1;
    padding: 32px;
    background: var(--bg-light);
}

/* ============================================
   SEÇÃO PRODUTOS E SERVIÇOS
   ============================================ */

.products-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

@media (max-width: 1200px) {
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .service-grid {
        grid-template-columns: 1fr;
    }
}

.service-card {
    background: white;
    border-radius: 20px;
    padding: 40px 28px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: none;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.service-card.green {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.service-card.green:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
}

.service-card.purple {
    background: linear-gradient(135deg, #6f42c1 0%, #9333ea 100%);
    color: white;
}

.service-card.purple:hover {
    background: linear-gradient(135deg, #5a32a3 0%, #7c2dd8 100%);
}

.service-card.blue {
    background: linear-gradient(135deg, #007bff 0%, #0d6efd 100%);
    color: white;
}

.service-card.blue:hover {
    background: linear-gradient(135deg, #0056b3 0%, #0a58ca 100%);
}

.service-card.orange {
    background: linear-gradient(135deg, #fd7e14 0%, #ff6b35 100%);
    color: white;
}

.service-card.orange:hover {
    background: linear-gradient(135deg, #dc6502 0%, #e55a2b 100%);
}

.service-card.gray {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.service-card.gray:hover {
    background: linear-gradient(135deg, #5a6268 0%, #3d4146 100%);
}

.service-icon {
    font-size: 64px;
    margin-bottom: 20px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.service-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.service-subtitle {
    font-size: 14px;
    opacity: 0.95;
    color: white;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.service-icon {
    font-size: 64px;
    margin-bottom: 20px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.service-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.service-subtitle {
    font-size: 14px;
    opacity: 0.95;
    color: white;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ============================================
   CARDS DE CONTEÚDO
   ============================================ */

.content-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--bg-light);
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

/* ============================================
   STATS GRID
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-red);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-gray);
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.stat-card .value {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-red);
    line-height: 1;
}

/* ============================================
   TABELAS
   ============================================ */

.data-table {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-light);
}

th {
    padding: 16px 24px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-gray);
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-dark);
}

tbody tr {
    transition: background 0.2s;
}

tbody tr:hover {
    background: var(--bg-light);
}

/* ============================================
   BOTÕES
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    background: var(--primary-red);
    color: white;
}

.btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--primary-blue);
}

.btn-secondary:hover {
    background: #0056b3;
}

.btn-success {
    background: var(--primary-green);
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: var(--primary-red);
}

.btn-danger:hover {
    background: #c82333;
}

/* ============================================
   FORMULÁRIOS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-red);
}

/* ============================================
   ALERTAS
   ============================================ */

.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-color: var(--primary-green);
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-color: var(--primary-red);
    color: #721c24;
}

/* ============================================
   SEÇÃO EXTRATO (ESTILO EB GATEWAYS)
   ============================================ */

.statement-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 1024px) {
    .statement-section {
        grid-template-columns: 1fr;
    }
}

.statement-card {
    min-height: 250px;
}

.statement-card .card-header {
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 0;
}

.statement-content {
    padding: 0;
}

.balance-row {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 28px;
}

.balance-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.balance-label {
    font-size: 14px;
    color: var(--text-gray);
    font-weight: 500;
}

.balance-amount {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.balance-amount.positive {
    color: var(--text-dark);
}

.balance-amount.negative {
    color: var(--primary-red);
    display: flex;
    align-items: center;
    gap: 8px;
}

.eye-icon {
    font-size: 18px;
    opacity: 0.7;
}

.statement-filters {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    padding-top: 20px;
}

.filter-btn {
    padding: 8px 20px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.filter-btn.active {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
}

.approvals-card {
    min-height: 250px;
}

.approvals-card .card-header {
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 0;
}

.approvals-content {
    padding: 24px;
    min-height: 150px;
}

/* ============================================
   RESPONSIVO
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content-wrapper {
        margin-left: 0;
    }
    
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
