/* Estilos Globais e Personalizações */
body { 
    font-family: 'Inter', sans-serif; 
    background-color: #f7fafc; 
    background-image: radial-gradient(circle at top right, #e0e7ff, transparent 40%);
    transition: background-color .3s ease;
    overflow-x: hidden;
}
.dark body { 
    background-color: #1a202c; 
    background-image: radial-gradient(circle at top right, #2c3e50, transparent 50%);
}

/* Scrollbar Personalizada */
::-webkit-scrollbar { width: 6px; height: 6px; } 
::-webkit-scrollbar-track { background: #e2e8f0; }
.dark ::-webkit-scrollbar-track { background: #2d3748; }
::-webkit-scrollbar-thumb { background: #a0aec0; border-radius: 10px; }
.dark ::-webkit-scrollbar-thumb { background: #4a5568; }

/* Utilitários */
[data-lucide] { width: 1em; height: 1em; }
.fade-in { animation: fadeIn .5s ease-in-out; }
@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

#theme-toggle-light-icon, .dark #theme-toggle-dark-icon { display: none; }
.dark #theme-toggle-light-icon { display: inline-block; }

.modal-input { 
    padding: .625rem .75rem; 
    border: 1px solid #cbd5e0; 
    border-radius: .5rem; 
    background: #fff; 
    color: #2d3748; 
    transition: box-shadow .15s, border-color .15s; 
}
.dark .modal-input { 
    background: #2d3748; 
    border-color: #4a5568; 
    color: #e2e8f0; 
}
.modal-input:focus { 
    outline: none; 
    border-color: #4299e1; 
    box-shadow: 0 0 0 2px #4299e1; 
}

.card-hover { 
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out; 
}
.card-hover:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); 
}
.dark .card-hover:hover { 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1); 
}

.truncate-text { 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.custom-scrollbar::-webkit-scrollbar { width: 4px; height: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb { 
    background: #cbd5e0; 
    border-radius: 4px; 
}
.dark .custom-scrollbar::-webkit-scrollbar-thumb { 
    background: #4a5568; 
}

canvas { cursor: pointer; }

/* Estilos para Modais */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal-container {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 1.5rem;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: transition-all;
}

.dark .modal-container {
    background: #1f2937;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
}

.dark .modal-header {
    border-color: #374151;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 1rem;
}

.dark .modal-title {
    color: white;
}

.modal-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark .modal-subtitle {
    color: #9ca3af;
}

.modal-close-btn {
    color: #9ca3af;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: color 0.2s, background-color 0.2s;
}

.modal-close-btn:hover {
    color: #4b5563;
    background-color: #f3f4f6;
}

.dark .modal-close-btn:hover {
    color: white;
    background-color: #374151;
}

.modal-search-input {
    padding-left: 2.25rem;
    padding-right: 1rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    width: 100%;
    background-color: #f9fafb;
    color: #1f2937;
    font-size: 0.875rem;
    transition: box-shadow 0.2s;
}

.dark .modal-search-input {
    background-color: rgba(55, 65, 81, 0.5);
    border-color: #4b5563;
    color: #e5e7eb;
}

.modal-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px #3b82f6;
}

.modal-content {
    flex-grow: 1;
    overflow-x: auto;
}

.modal-table {
    width: 100%;
    font-size: 0.875rem;
    text-align: left;
    color: #6b7280;
    min-width: 800px;
}

.dark .modal-table {
    color: #9ca3af;
}

.modal-table thead {
    font-size: 0.75rem;
    color: #374151;
    background-color: #f9fafb;
    position: sticky;
    top: 0;
}

.dark .modal-table thead {
    color: #9ca3af;
    background-color: rgba(55, 65, 81, 0.5);
}

.modal-table th {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-table tbody tr {
    background-color: white;
    border-bottom: 1px solid #e5e7eb;
}

.dark .modal-table tbody tr {
    background-color: #1f2937;
    border-color: #374151;
}

.modal-table tbody tr:hover {
    background-color: #f9fafb;
}

.dark .modal-table tbody tr:hover {
    background-color: rgba(55, 65, 81, 0.5);
}

.modal-table td {
    padding: 1rem 1.5rem;
    white-space: nowrap;
}

.modal-filter-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    background-color: #f3f4f6;
    color: #374151;
}

.dark .filter-btn {
    background-color: #374151;
    color: #d1d5db;
}

.filter-btn.active {
    background-color: #3b82f6;
    color: white;
}

.filter-btn:hover {
    background-color: #e5e7eb;
}

.dark .filter-btn:hover {
    background-color: #4b5563;
}

.filter-btn.active:hover {
    background-color: #2563eb;
}

.modal-scrollable-content {
    overflow-y: auto;
    padding-right: 0.5rem;
}

.info-section {
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.dark .info-section {
    background-color: rgba(55, 65, 81, 0.3);
}

.info-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dark .info-section-title {
    color: #d1d5db;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.info-item {
    padding: 0.75rem;
    background: white;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
}

.dark .info-item {
    background: #1f2937;
    border-color: #374151;
}

.info-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.dark .info-label {
    color: #9ca3af;
}

.info-value {
    font-weight: 500;
    font-size: 1.125rem;
    color: #111827;
}

.dark .info-value {
    color: white;
}

.modal-icon {
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
    width: 3rem;
    border-radius: 9999px;
}

.modal-text {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.dark .modal-text {
    color: #9ca3af;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.modal-btn-secondary {
    padding: 0.625rem 1.25rem;
    color: #374151;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.dark .modal-btn-secondary {
    background: #374151;
    color: #d1d5db;
    border-color: #4b5563;
}

.modal-btn-secondary:hover {
    background-color: #f9fafb;
}

.dark .modal-btn-secondary:hover {
    background-color: #4b5563;
}

.modal-btn-danger {
    padding: 0.625rem 1.25rem;
    background-color: #dc2626;
    color: white;
    border-radius: 0.5rem;
    font-weight: 500;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s;
}

.modal-btn-danger:hover {
    background-color: #b91c1c;
}

/* Estilos para estado vazio */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    background: white;
    border-radius: 0.75rem;
    border: 2px dashed #d1d5db;
    text-align: center;
}

.dark .empty-state {
    background: #1f2937;
    border-color: #374151;
}

.empty-state-icon {
    padding: 1rem;
    background: #f3f4f6;
    border-radius: 9999px;
    margin-bottom: 1rem;
}

.dark .empty-state-icon {
    background: rgba(55, 65, 81, 0.5);
}

.empty-state-title {
    color: #6b7280;
    font-weight: 500;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.dark .empty-state-title {
    color: #9ca3af;
}

.empty-state-description {
    color: #9ca3af;
    font-size: 0.875rem;
}

.dark .empty-state-description {
    color: #6b7280;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.dark .badge-success {
    background-color: rgba(6, 95, 70, 0.3);
    color: #6ee7b7;
    border-color: #10b981;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.dark .badge-warning {
    background-color: rgba(146, 64, 14, 0.3);
    color: #fbbf24;
    border-color: #f59e0b;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.dark .badge-danger {
    background-color: rgba(153, 27, 27, 0.3);
    color: #f87171;
    border-color: #ef4444;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.dark .badge-info {
    background-color: rgba(30, 64, 175, 0.3);
    color: #60a5fa;
    border-color: #3b82f6;
}

.badge-neutral {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.dark .badge-neutral {
    background-color: rgba(55, 65, 81, 0.3);
    color: #d1d5db;
    border-color: #4b5563;
}
