@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;
    --slate-850: #172033;
}

* {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
    height: 100%;
}

html {
    font-size: 16px;
}

body {
    background-color: #f8fafc;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.form-input,
.form-select {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #334155;
    background-color: #fff !important;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    opacity: 1 !important;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Ocultar flatpickr completamente */
.flatpickr-calendar,
.flatpickr-wrapper,
.flatpickr-months,
.flatpickr-weekdays,
.flatpickr-days,
.flatpickr-current-month,
input.flatpickr-input {
    display: none !important;
}

/* Customização Air Datepicker */
.air-datepicker {
    border: 1px solid #cbd5e1 !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    z-index: 9999 !important;
}

.air-datepicker-nav {
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 0.75rem !important;
}

.air-datepicker-nav--title {
    color: #1e293b !important;
    font-weight: 600 !important;
}

.air-datepicker-nav--action {
    color: #64748b !important;
}

.air-datepicker-nav--action:hover {
    background: #f1f5f9 !important;
}

.air-datepicker-body--day-name {
    color: #64748b !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 0.75rem !important;
}

.air-datepicker-cell {
    border-radius: 0.375rem !important;
}

.air-datepicker-cell.-day- {
    color: #334155 !important;
}

.air-datepicker-cell.-day-:hover {
    background: #e0e7ff !important;
    color: #2563eb !important;
}

.air-datepicker-cell.-selected- {
    background: #2563eb !important;
    color: #fff !important;
}

.air-datepicker-cell.-current- {
    border: 2px solid #2563eb !important;
    color: #2563eb !important;
}

.air-datepicker-cell.-disabled- {
    color: #cbd5e1 !important;
    opacity: 0.5 !important;
}

.air-datepicker-cell.-other-month- {
    color: #cbd5e1 !important;
}

.data-inicial,
.data-final {
    overflow: visible !important;
}

.form-input::placeholder {
    color: #94a3b8;
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: 0.5rem;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    border: none;
}

.btn-primary {
    color: #fff;
    background-color: #2563eb;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    color: #475569;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    color: #334155;
}

.card {
    background-color: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    max-width: 100%;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.card-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.card-body {
    padding: 1.25rem;
}

.alert {
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.alert-danger {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.alert-warning {
    background-color: #fefce8;
    border: 1px solid #fef08a;
    color: #a16207;
}

.stat-card {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
}

.stat-card-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.stat-card-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    margin-top: 0.25rem;
}

.stat-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: center !important;
    font-weight: 600;
    color: #475569;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
}

.data-table th:last-child {
    border-right: none;
}

.data-table td {
    padding: 0.75rem 1rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
}

.data-table td:last-child {
    border-right: none;
}

.text-center {
    text-align: center !important;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.page-subtitle {
    font-size: 0.875rem;
    color: #64748b;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.breadcrumb-item {
    color: #64748b;
}

.breadcrumb-item.active {
    color: #1e293b;
    font-weight: 500;
}

.breadcrumb-separator {
    color: #cbd5e1;
}

.dt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
}

.dt-button,
.buttons-excel,
.buttons-pdf,
.buttons-csv,
.buttons-print,
.buttons-copy {
    display: inline-flex !important;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 0.375rem !important;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    background: #2563eb !important;
}

.dt-button:hover {
    background: #1d4ed8 !important;
}

.buttons-excel {
    background: #059669 !important;
}

.buttons-excel:hover {
    background: #047857 !important;
}

.buttons-pdf {
    background: #dc2626 !important;
}

.buttons-pdf:hover {
    background: #b91c1c !important;
}

.buttons-csv {
    background: #0891b2 !important;
}

.buttons-csv:hover {
    background: #0e7490 !important;
}

.buttons-print {
    background: #6366f1 !important;
}

.buttons-print:hover {
    background: #4f46e5 !important;
}

.buttons-copy {
    background: #64748b !important;
}

.buttons-copy:hover {
    background: #475569 !important;
}

.dataTables_wrapper {
    width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    display: block;
}

.dataTables_wrapper::-webkit-scrollbar {
    height: 10px;
}

.dataTables_wrapper::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.dataTables_wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.dataTables_wrapper::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: auto !important;
}

.dataTables_scrollBody::-webkit-scrollbar {
    height: 10px;
    width: 8px;
}

.dataTables_scrollBody::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.dataTables_scrollBody::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

.dataTables_scrollBody::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    display: block;
    position: relative;
}

.table-responsive::-webkit-scrollbar {
    height: 10px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dataTables_wrapper > .row {
    margin: 0;
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin: 0;
    padding: 0;
}

.dataTables_wrapper .dataTables_filter input {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dataTables_wrapper .dataTables_length select {
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    margin: 0 0.5rem;
}

.dataTables_wrapper .dataTables_paginate {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: #fff;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dataTables_wrapper .dataTables_info {
    font-size: 0.875rem;
    color: #64748b;
}

table.dataTable td.dt-control {
    text-align: center;
    cursor: pointer;
    padding: 0.5rem !important;
}

table.dataTable td.dt-control:before {
    height: 1.75rem;
    width: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    box-sizing: content-box;
    text-align: center;
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.75rem;
    line-height: 1;
    content: "\f078";
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    transition: all 0.2s ease;
}

table.dataTable td.dt-control:hover:before {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

table.dataTable tr.dt-hasChild td.dt-control:before {
    content: "\f077";
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

table.dataTable tr.dt-hasChild td.dt-control:hover:before {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(71, 85, 105, 0.3);
}

.chart-container {
    position: relative;
    width: 100%;
    min-height: 350px;
    height: 350px;
    padding: 1.5rem;
}

.chart-container canvas {
    max-width: 100%;
}

@media (max-width: 640px) {
    .form-row {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
}

.loading-spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    color: #94a3b8;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.25rem;
}

.empty-state-description {
    font-size: 0.875rem;
    color: #64748b;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.input-with-icon {
    padding-left: 2.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #475569;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
    accent-color: #2563eb;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

#sidebar.sidebar-expanded {
    width: 16rem;
}

#sidebar.sidebar-collapsed {
    width: 4.5rem;
}

#sidebar.sidebar-collapsed .sidebar-text {
    display: none;
}

#sidebar.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

#sidebar.sidebar-collapsed #sidebar-collapse-btn {
    display: none;
}

#sidebar.sidebar-collapsed #sidebar-expand-btn {
    display: block;
}

#sidebar.sidebar-collapsed #sidebar-toggle-container {
    justify-content: center;
}

.main-content-expanded {
    margin-left: 16rem;
}

.main-content-collapsed {
    margin-left: 4.5rem;
}

@media (max-width: 1023px) {
    .main-content-expanded,
    .main-content-collapsed {
        margin-left: 0;
    }
    
    #sidebar {
        width: 16rem !important;
    }
    
    #sidebar.sidebar-collapsed .sidebar-text {
        display: block !important;
    }
    
    #sidebar.sidebar-collapsed .sidebar-link {
        justify-content: flex-start !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
}
