/* Clean Finance Dashboard - Minimalist Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --primary-light: #EFF6FF;
    --success: #10B981;
    --success-light: #D1FAE5;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --info: #3B82F6;
    --info-light: #DBEAFE;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

body {
    background-color: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

/* Clean Card Design */
.card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    background-color: white;
}

.card-body {
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.primary {
    background-color: var(--primary-light);
    color: var(--primary);
}

.stat-icon.success {
    background-color: var(--success-light);
    color: var(--success);
}

.stat-icon.danger {
    background-color: var(--danger-light);
    color: var(--danger);
}

.stat-icon.warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

.stat-icon.info {
    background-color: var(--info-light);
    color: var(--info);
}

/* Buttons - Modern Design System */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Success Button */
.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.35);
}

/* Danger Button */
.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #DC2626 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.35);
}

/* Secondary/Outline Button */
.btn-secondary,
.btn-outline {
    background-color: white;
    color: var(--gray-700);
    border: 1.5px solid var(--gray-300);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover,
.btn-outline:hover {
    background-color: var(--gray-50);
    border-color: var(--gray-400);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
}

/* Ghost Button */
.btn-ghost {
    background-color: transparent;
    color: var(--gray-600);
    box-shadow: none;
    padding: 0.5rem 1rem;
}

.btn-ghost:hover {
    background-color: var(--gray-100);
    color: var(--gray-900);
}

/* Icon-only Button */
.btn-icon {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
    padding: 0.375rem;
}

/* Button Sizes */
.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 12px;
}

/* Button Groups */
.btn-group {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}

/* Loading State */
.btn.loading {
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Floating Action Button (FAB) */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Mini FAB */
.fab-mini {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
}

/* Action Buttons Enhancement */
.action-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.action-btn:hover {
    transform: scale(1.15);
}

.action-btn.edit {
    color: var(--primary);
}

.action-btn.edit:hover {
    background-color: var(--primary-light);
}

.action-btn.delete {
    color: var(--danger);
}

.action-btn.delete:hover {
    background-color: var(--danger-light);
}

.action-btn.success {
    color: var(--success);
}

.action-btn.success:hover {
    background-color: var(--success-light);
}

/* Sidebar */
.sidebar {
    background-color: white;
    border-right: 1px solid var(--gray-200);
    height: 100vh;
    width: 260px;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.sidebar-nav {
    padding: 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
}

.nav-link:hover {
    background-color: var(--gray-100);
    color: var(--gray-900);
}

.nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.nav-link i {
    margin-right: 0.75rem;
    font-size: 1.125rem;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    background-color: var(--gray-50);
}

/* Header */
.header {
    background-color: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Tables */
.table {
    width: 100%;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

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

.table thead {
    background-color: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
}

.table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
}

.table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    font-size: 0.875rem;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: var(--gray-50);
    transform: scale(1.01);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

/* Table Responsive */
@media (max-width: 768px) {
    .table {
        box-shadow: none;
        border-radius: 0;
    }
    
    .table table {
        display: block;
    }
    
    .table thead {
        display: none;
    }
    
    .table tbody {
        display: block;
    }
    
    .table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--gray-200);
        border-radius: 8px;
        padding: 1rem;
        background: white;
        box-shadow: var(--shadow-sm);
    }
    
    .table tr:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }
    
    .table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        text-align: right;
    }
    
    .table td:first-child {
        padding-top: 0;
    }
    
    .table td:last-child {
        padding-bottom: 0;
    }
    
    .table td:before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.75rem;
        color: var(--gray-500);
    }
}

/* Badges */
.badge {
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success);
}

.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger);
}

.badge-warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary);
}

.badge-info {
    background-color: var(--info-light);
    color: var(--info);
}

/* Status Indicators */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-indicator.success {
    background-color: var(--success);
}

.status-indicator.warning {
    background-color: var(--warning);
}

/* Action Buttons in Table */
.table-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.table-actions .btn-ghost {
    padding: 0.375rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.table-actions .btn-ghost:hover {
    transform: scale(1.1);
}

/* Value Display */
.value-display {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--gray-900);
}

.value-display.negative {
    color: var(--danger);
}

/* Date Display */
.date-display {
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
}

/* Empty State Improvement */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    color: var(--gray-300);
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Forms */
.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--gray-300);
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background-color: white;
    color: var(--gray-700);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.form-control:hover {
    border-color: var(--gray-400);
}

/* Modern Select Styling */
select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    appearance: none;
    cursor: pointer;
}

select.form-control:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%233b82f6' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

/* Enhanced Form Labels */
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
    letter-spacing: 0.025em;
}

/* Filter Form Enhancements */
.filter-form {
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.5rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.25rem;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.5rem;
}

/* Compact Filter Style */
.filter-compact {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-compact .form-control {
    min-width: 140px;
    margin-bottom: 0;
}

.filter-compact .form-label {
    margin-bottom: 0;
    margin-right: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-500);
    white-space: nowrap;
}

/* Loading State for Forms */
.form-control.loading {
    background-color: var(--gray-50);
    pointer-events: none;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Utilities */
.text-muted {
    color: var(--gray-500);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-primary {
    color: var(--primary);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Filters Card Enhancement */
.filters-card {
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
}

/* Enhanced Cards */
.card {
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.card:hover::before {
    transform: translateX(0);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .header h2 {
        font-size: 1.25rem !important;
    }
    
    .header p {
        font-size: 0.75rem !important;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Loading states */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Cartões específicos */
.cartao-card {
    transition: all 0.3s ease;
    position: relative;
}

.cartao-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.utilization-bar {
    height: 8px;
    background-color: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.utilization-progress {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.utilization-progress::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.fatura-info {
    background: linear-gradient(135deg, var(--gray-50) 0%, rgba(255,255,255,0.8) 100%);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.fatura-info::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--success));
}

.info-alert {
    border-left: 4px solid var(--primary);
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.success-alert {
    border-left: 4px solid var(--success);
    background: linear-gradient(135deg, var(--success-light) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.warning-alert {
    border-left: 4px solid var(--warning);
    background: linear-gradient(135deg, var(--warning-light) 0%, rgba(245, 158, 11, 0.05) 100%);
}

/* Modal melhorado */
.modal-backdrop {
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    animation: slideUp 0.3s ease;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

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

/* Grid responsivo para cartões */
.cartoes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .cartoes-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .cartao-card {
        margin-bottom: 1rem;
    }
    
    .fatura-info {
        padding: 1rem;
    }
}

/* Melhorias nos botões de ação */
.btn-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-actions .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.btn-ghost.text-danger:hover {
    background-color: var(--danger-light);
    color: var(--danger);
}

/* ===== MOBILE APP-STYLE ENHANCEMENTS ===== */

/* Force hide mobile elements on desktop */
@media (min-width: 769px) {
    .mobile-filters-overlay,
    .mobile-filters-panel,
    .mobile-filters-content,
    .mobile-filters-header,
    .mobile-filters-grid,
    .mobile-filters-actions,
    .mobile-filters-form,
    .mobile-filter-toggle,
    .mobile-filter-container,
    #mobileFiltersOverlay,
    #mobileFiltersPanel {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
    z-index: 100;
    display: none;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    text-decoration: none;
    color: var(--gray-500);
    transition: all 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    border-radius: 12px;
}

.bottom-nav-item.active {
    color: var(--primary);
    background-color: var(--primary-light);
}

.bottom-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.bottom-nav-item span {
    font-size: 0.6875rem;
    font-weight: 500;
    text-align: center;
}

/* Mobile Hamburger Menu */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    color: var(--gray-700);
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.mobile-menu-toggle i {
    font-size: 1.125rem;
    transition: transform 0.3s ease;
}

.mobile-menu-toggle.active {
    background: var(--gray-100);
    color: var(--gray-900);
}

.mobile-menu-toggle.active i {
    transform: rotate(90deg);
}

/* Enhanced Floating Action Button */
.fab-container {
    position: fixed;
    bottom: calc(80px + env(safe-area-inset-bottom));
    right: 1.5rem;
    z-index: 200;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    background: var(--primary-dark);
}

.fab:active {
    transform: scale(0.95);
}

/* FAB Speed Dial */
.fab-speed-dial {
    position: absolute;
    bottom: 0;
    right: 0;
}

.fab-speed-dial-items {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab-speed-dial.active .fab-speed-dial-items {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.fab-speed-dial-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fab-mini {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    cursor: pointer;
    color: white;
}

.fab-mini.success {
    background: var(--success);
}

.fab-mini.success:hover {
    background: #059669;
}

.fab-mini.danger {
    background: var(--danger);
}

.fab-mini.danger:hover {
    background: #DC2626;
}

.fab-mini.warning {
    background: var(--warning);
}

.fab-mini.warning:hover {
    background: #D97706;
}

.fab-mini.primary {
    background: var(--primary);
}

.fab-mini.primary:hover {
    background: var(--primary-dark);
}

.fab-mini:hover {
    transform: scale(1.1);
}

.fab-label {
    background: var(--gray-800);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Bottom Sheet Modal */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.bottom-sheet-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 301;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-sheet.active {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--gray-300);
    border-radius: 2px;
    margin: 1rem auto 0;
}

.bottom-sheet-header {
    padding: 1.5rem 1.5rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.bottom-sheet-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.bottom-sheet-body {
    padding: 1.5rem;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

/* Mobile Card Enhancements */
.mobile-card {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Mobile card responsiveness */
@media (max-width: 768px) {
    .mobile-card {
        border-radius: 12px;
        padding: 1rem;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    }
}

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

.mobile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.mobile-card:hover::before {
    transform: scaleX(1);
}

.mobile-card-header {
    padding: 1.25rem 1.25rem 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.mobile-card-body {
    padding: 1.25rem;
}

.mobile-card-actions {
    padding: 0 1.25rem 1.25rem;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Swipe Actions */
.swipe-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.swipe-content {
    position: relative;
    z-index: 2;
    background: white;
    transition: transform 0.3s ease;
    border-radius: 12px;
}

.swipe-actions {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    z-index: 1;
}

.swipe-action {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.125rem;
    min-width: 80px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.swipe-action.edit {
    background: var(--primary);
}

.swipe-action.delete {
    background: var(--danger);
}

.swipe-action.complete {
    background: var(--success);
}

.swipe-action:hover {
    filter: brightness(1.1);
}

/* Pull to Refresh */
.pull-refresh-container {
    position: relative;
    overflow: hidden;
}

.pull-refresh-indicator {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    z-index: 10;
}

.pull-refresh-indicator.active {
    top: 10px;
}

.pull-refresh-indicator i {
    font-size: 1.125rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Enhanced Touch Targets */
.touch-target {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Form Enhancements */
.mobile-form-group {
    margin-bottom: 1.5rem;
}

.mobile-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.mobile-form-control {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.mobile-form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

/* Mobile Chart Optimizations */
.mobile-chart-container {
    position: relative;
    height: 250px;
    width: 100%;
    margin-bottom: 1rem;
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 768px) {
    /* Show mobile navigation */
    .bottom-nav {
        display: block;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Hide desktop sidebar on mobile */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    /* Add overlay for mobile sidebar */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Adjust main content for mobile */
    .main-content {
        margin-left: 0;
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
    
    /* Mobile header adjustments */
    .header {
        padding: 1rem;
        position: relative;
        display: flex !important;
        align-items: center;
        gap: 1rem;
    }
    
    /* Show mobile menu toggle in header */
    .mobile-menu-toggle {
        display: flex !important;
        margin-right: 0.5rem;
    }
    
    .header h2 {
        font-size: 1.125rem !important;
        line-height: 1.2;
        margin-bottom: 0.125rem !important;
    }
    
    .header p {
        font-size: 0.8125rem !important;
        margin-top: 0 !important;
    }
    
    /* Stats Grid Mobile - Two Columns */
    .stat-card {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .stat-card h3 {
        font-size: 1.25rem !important;
        margin-bottom: 0.25rem;
    }
    
    .stat-card p {
        font-size: 0.75rem !important;
        margin-bottom: 0.25rem;
    }
    
    .stat-card .badge {
        font-size: 0.625rem;
        padding: 0.25rem 0.5rem;
    }
    
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        border-radius: 8px;
    }
    
    /* Mobile header actions */
    .header-actions {
        display: none;
    }
    
    /* Desktop filters - show by default */
    .filter-compact {
        display: block;
    }
    
    /* Mobile filter toggle - hidden by default */
    .mobile-filter-toggle {
        display: none !important;
    }
    
    /* Mobile styles */
    @media (max-width: 768px) {
        /* Hide desktop filters on mobile */
        .filter-compact {
            display: none !important;
        }
        
        /* Show mobile filter container and toggle on mobile */
        .mobile-filter-container {
            display: flex !important;
            align-items: center;
            gap: 0.75rem;
        }
        
        .mobile-filter-toggle {
            display: inline-flex !important;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            background: white;
            border: 1px solid var(--gray-300);
            border-radius: 8px;
            font-size: 0.875rem;
            color: var(--gray-700);
            cursor: pointer;
            transition: all 0.2s ease;
        }
    }
    
    /* Ensure desktop always hides mobile button */
    @media (min-width: 769px) {
        .mobile-filter-toggle {
            display: none !important;
        }
    }
    
    .mobile-filter-toggle:hover {
        background: var(--gray-50);
        border-color: var(--gray-400);
    }
    
    .mobile-filter-toggle.active {
        background: var(--primary-light);
        border-color: var(--primary);
        color: var(--primary);
    }
    
    .mobile-filters-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 400;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        display: none; /* Hidden by default */
    }
    
    .mobile-filters-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .mobile-filters-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 401;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        display: none; /* Hidden by default */
    }
    
    .mobile-filters-panel.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Show mobile filters panel only on mobile */
    @media (max-width: 768px) {
        .mobile-filters-overlay,
        .mobile-filters-panel {
            display: block !important;
        }
    }
    
    /* Ensure desktop always hides mobile filters panel */
    @media (min-width: 769px) {
        .mobile-filters-overlay,
        .mobile-filters-panel,
        #mobileFiltersOverlay,
        #mobileFiltersPanel {
            display: none !important;
            visibility: hidden !important;
            opacity: 0 !important;
        }
    }
    
    .mobile-filters-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-radius: 20px 20px 0 0;
        padding: 1.5rem;
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    
    .mobile-filters-panel.active .mobile-filters-content {
        transform: translateY(0);
    }
    
    .mobile-filters-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--gray-200);
    }
    
    .mobile-filters-grid {
        display: grid;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .mobile-filters-actions {
        display: flex;
        gap: 1rem;
    }
    
    /* Enhanced mobile stats grid */
    .mobile-stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    /* Stats Grid Mobile Override - Two Columns */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    /* For 3 cards, make the last one span full width */
    .stats-grid:has(.stat-card:nth-child(3):last-child) .stat-card:last-child {
        grid-column: 1 / -1;
    }
    
    /* Charts Grid Mobile - Stack Charts */
    .charts-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Cartões Grid Mobile - Two Columns */
    .cartoes-cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    .cartao-mini-card {
        padding: 0.75rem !important;
    }
    
    .mobile-card.cartao-mini-card h4 {
        font-size: 0.8125rem !important;
    }
    
    .mobile-card.cartao-mini-card .utilization-bar {
        height: 5px !important;
    }
    
    /* Mobile table replacements */
    .mobile-list {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .mobile-list-item {
        background: white;
        border-radius: 12px;
        padding: 1rem;
        border: 1px solid var(--gray-200);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
        transition: all 0.2s ease;
    }
    
    .mobile-list-item:hover {
        transform: translateY(-1px);
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    }
    
    /* Optimize mobile list content */
    .mobile-list-item h4 {
        font-size: 0.9375rem;
        margin-bottom: 0.5rem;
        line-height: 1.2;
    }
    
    /* Better mobile spacing for badges and content */
    .mobile-list-item .badge {
        margin-right: 0.375rem;
        margin-bottom: 0.25rem;
    }
    
    /* Hide desktop table headers on mobile */
    .table thead {
        display: none;
    }
    
    /* Transform table rows to cards */
    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        background: white;
        border-radius: 12px;
        padding: 1rem;
        border: 1px solid var(--gray-200);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    }
    
    .table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
    }
    
    .table tbody td:before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--gray-600);
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.025em;
    }
    
    /* Mobile chart containers */
    .chart-container {
        height: 250px;
    }
    
    /* Enhanced mobile cards */
    .stat-card {
        padding: 1rem;
        border-radius: 12px;
    }
    
    /* Mobile button adjustments */
    .btn {
        min-height: 44px;
        font-size: 0.9375rem;
        padding: 0.75rem 1.5rem;
        border-radius: 12px;
    }
    
    .btn-sm {
        min-height: 36px;
        padding: 0.5rem 1rem;
        border-radius: 8px;
    }
    
    /* Improve touch targets for action buttons */
    .action-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
    }
    
    /* Better spacing for mobile forms */
    .form-control {
        margin-bottom: 0.5rem;
    }
    
    /* Mobile-specific spacing */
    .stat-card h3 {
        line-height: 1.1;
    }
    
    /* Better visual hierarchy on mobile */
    .badge {
        font-size: 0.6875rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Improved readability for values */
    .value-display {
        font-size: 1rem;
        line-height: 1.2;
    }
    
    /* Mobile form improvements */
    .form-control {
        min-height: 44px;
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
    
    /* Mobile content padding */
    .main-content > div[style*="padding: 2rem"] {
        padding: 1rem !important;
    }
    
    /* Filter form mobile layout */
    .filter-compact {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        padding: 1rem;
    }
    
    .filter-compact > div {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filter-compact .form-control {
        min-width: auto;
        width: 100%;
    }
    
    /* Mobile action buttons */
    .mobile-actions {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        margin-top: 1rem;
    }
    
    .mobile-actions .btn {
        flex: 1;
        min-width: 0;
    }
}

/* Ensuring consistent light mode colors */
.bottom-nav {
    background: white;
    border-top-color: var(--gray-200);
}

.bottom-sheet {
    background: white;
    color: var(--gray-800);
}

.mobile-card {
    background: white;
    border-color: var(--gray-200);
}

.mobile-form-control {
    background: white;
    border-color: var(--gray-200);
    color: var(--gray-700);
}

/* Print styles */
@media print {
    .sidebar,
    .header,
    .btn,
    .no-print,
    .bottom-nav,
    .fab-container,
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding-bottom: 0 !important;
    }
    
    body {
        background: white !important;
    }
}