/* Reset e configurações globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #ffffff;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #00C881, #00a86b);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: -0.5px;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    margin-left: auto;
}

.sidebar-toggle:hover {
    background: #f8f9fa;
    color: #495057;
}

/* Navigation */
.nav-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #adb5bd;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 20px;
    margin-bottom: 8px;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .nav-section-title {
    opacity: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #6c757d;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item:hover {
    background: #f8f9fa;
    color: #495057;
}

.nav-item.active {
    background: rgba(0, 200, 129, 0.1);
    color: #00C881;
    border-right: 3px solid #00C881;
}

.nav-item i {
    width: 20px;
    font-size: 16px;
    margin-right: 12px;
    flex-shrink: 0;
}

.nav-item-text {
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .nav-item-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .nav-item {
    padding: 12px;
    justify-content: center;
}

/* Submenu */
.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-item.has-submenu.active + .nav-submenu {
    max-height: 300px;
}

.nav-submenu .nav-item {
    padding-left: 52px;
    font-size: 14px;
}

.sidebar.collapsed .nav-submenu {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed + .main-content {
    margin-left: 60px;
}

/* Header */
.header {
    background: white;
    padding: 16px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb a {
    color: #6c757d;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #495057;
}

.breadcrumb .current {
    color: #495057;
    font-weight: 500;
}

.breadcrumb span {
    color: #adb5bd;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-greeting {
    font-size: 14px;
    color: #495057;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: #00C881;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.logout-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #f8f9fa;
    color: #dc3545;
}

/* Dashboard Content */
.dashboard-content {
    padding: 24px;
    flex: 1;
    background: #f8fafc;
}

.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
}

.page-subtitle {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 16px;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.date-filter select,
.date-filter input {
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.date-filter button {
    padding: 8px 16px;
    background: #00C881;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.date-filter button:hover {
    background: #00a86b;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: none;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.3s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-color, #00C881);
}

.stat-card.revenue::before {
    background: #00C881;
}

.stat-card.sales::before {
    background: #00C881;
}

.stat-card.liquid::before {
    background: #00C881;
}

.stat-card.accounts::before {
    background: #00C881;
}

.stat-card.refunds::before {
    background: #00C881;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 200, 129, 0.3);
}

.stat-icon.revenue {
    background: linear-gradient(135deg, #00C881, #00a86b);
}

.stat-icon.sales {
    background: linear-gradient(135deg, #00C881, #00a86b);
}

.stat-icon.liquid {
    background: linear-gradient(135deg, #00C881, #00a86b);
}

.stat-icon.accounts {
    background: linear-gradient(135deg, #00C881, #00a86b);
}

.stat-icon.refunds {
    background: linear-gradient(135deg, #00C881, #00a86b);
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 4px;
    line-height: 1;
}

.stat-subtitle {
    font-size: 12px;
    color: #adb5bd;
}

.stat-change {
    font-size: 12px;
    font-weight: 500;
    margin-top: 8px;
}

.stat-change.positive {
    color: #28a745;
}

.stat-change.negative {
    color: #dc3545;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 12px;
    border: none;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.table-title {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
}

.table-actions {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #00C881;
    color: white;
}

.btn-primary:hover {
    background: #00a86b;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-outline {
    background: transparent;
    border: 1px solid #e9ecef;
    color: #6c757d;
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid #f8f9fa;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.table td {
    font-size: 14px;
    color: #212529;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* Status badges */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.badge.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.badge.danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.badge.info {
    background: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
}

/* Forms */
.form-container {
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    color: #495057;
    background: white;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #00C881;
    box-shadow: 0 0 0 3px rgba(0, 200, 129, 0.1);
}

.form-control::placeholder {
    color: #adb5bd;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #212529;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
}

.modal-close:hover {
    color: #495057;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.2);
    color: #155724;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.2);
    color: #721c24;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.2);
    color: #856404;
}

.alert-info {
    background: rgba(23, 162, 184, 0.1);
    border-color: rgba(23, 162, 184, 0.2);
    color: #0c5460;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #00C881;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-overlay {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

.loading-overlay .loading {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

/* Skeleton loading for cards */
.stat-card.loading {
    pointer-events: none;
}

.stat-card.loading .stat-value {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    color: transparent;
    border-radius: 4px;
}

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Responsividade */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-content {
        padding: 16px;
    }
    
    .header {
        padding: 12px 16px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .table th,
    .table td {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 24px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .date-filter {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #00C881 0%, #00a86b 100%);
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.03)"/><circle cx="20" cy="60" r="0.5" fill="rgba(255,255,255,0.03)"/><circle cx="80" cy="40" r="0.5" fill="rgba(255,255,255,0.03)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.6;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0 auto;
    transform: translateX(0);
}

.login-logo {
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 64px;
    height: 64px;
    font-size: 28px;
    margin: 0 auto 16px;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: #00C881;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: #6c757d;
    font-size: 16px;
    margin-bottom: 40px;
    font-weight: 400;
}

.login-form {
    text-align: left;
}

.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 16px;
}

.input-group input {
    width: 100%;
    padding: 18px 18px 18px 50px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 15px;
    background: rgba(248, 249, 250, 0.8);
    transition: all 0.3s ease;
    font-weight: 500;
}

.input-group input:focus {
    outline: none;
    border-color: #00C881;
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 200, 129, 0.1);
    transform: translateY(-1px);
}

.login-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #00C881, #00a86b);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 16px;
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 200, 129, 0.4);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
