/**
 * LAUDO CONTROL - MODERN LAYOUT
 * Design System Ultra Moderno com Animações Fluidas
 * @version 2.1 - Premium Edition
 */

/* ==========================================
   RESET E BASE
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden !important;
    overflow-y: scroll !important;
    height: 100% !important;
    scrollbar-width: auto !important;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    @apply bg-gray-50 dark:bg-gray-900 text-gray-900 dark:text-gray-100;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden !important;
    overflow-y: scroll !important;
    position: relative;
    min-height: 100vh !important;
    height: auto !important;
    scrollbar-width: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* Background animado sutil */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* ==========================================
   LAYOUT PRINCIPAL
   ========================================== */

main.content {
    margin-left: 18rem; /* w-72 = 18rem */
    margin-top: 4rem;
    padding: 2.5rem;
    min-height: calc(100vh - 4rem);
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out;
    overflow-y: visible;
}

aside.w-20 ~ main.content {
    margin-left: 5rem;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 1024px) {
    main.content {
        margin-left: 0;
        padding: 1rem;
    }
}

/* ==========================================
   CARDS MODERNOS COM ANIMAÇÕES E DESTAQUE
   ========================================== */

.modern-card {
    @apply bg-white dark:bg-gray-800;
    padding: 2rem; /* 32px - aumentado de 2rem */
    border-radius: 24px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    animation: cardSlideIn 0.5s ease-out backwards;
}

/* Inner container para zona segura */
.modern-card-inner {
    padding: 0.5rem; /* Espaço extra interno */
}

/* Efeito de brilho sem overflow hidden */
.modern-card-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
    border-radius: 24px;
    pointer-events: none;
}

.modern-card:hover .modern-card-shine {
    left: 100%;
}

.dark .modern-card {
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.3),
        0 2px 4px -1px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Removido - usando .modern-card-shine ao invés */

.modern-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 2px rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

.dark .modern-card:hover {
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.5),
        0 10px 10px -5px rgba(0, 0, 0, 0.3),
        0 0 0 2px rgba(59, 130, 246, 0.3);
}

.modern-card:active {
    transform: translateY(-4px) scale(1.01);
}

.modern-card-header {
    @apply flex items-center justify-between mb-6 pb-4 border-b border-gray-200 dark:border-gray-700;
    animation: fadeIn 0.4s ease-out 0.2s backwards;
}

.modern-card-title {
    @apply text-2xl font-bold text-gray-800 dark:text-white flex items-center gap-3;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modern-card-subtitle {
    @apply text-sm text-gray-500 dark:text-gray-400 mt-1;
    animation: fadeIn 0.4s ease-out 0.3s backwards;
}

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

/* ==========================================
   BOTÕES MODERNOS COM RIPPLE EFFECT
   ========================================== */

.btn-modern {
    @apply inline-flex items-center gap-2 px-8 py-4 font-semibold text-sm;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 0 0 2px rgba(255, 255, 255, 0.1);
    transform: translateY(0);
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-modern:hover::before {
    width: 300px;
    height: 300px;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-modern:active {
    transform: translateY(0) scale(0.98);
    transition: transform 0.1s;
}

.btn-modern:active::before {
    width: 0;
    height: 0;
}

.btn-primary {
    @apply bg-gradient-to-r from-primary-500 via-primary-600 to-primary-700 text-white;
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

.btn-primary:hover {
    @apply from-primary-600 via-primary-700 to-primary-800;
    animation: gradientShift 1s ease infinite;
}

.btn-success {
    @apply bg-gradient-to-r from-green-500 via-green-600 to-green-700 text-white;
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

.btn-success:hover {
    @apply from-green-600 via-green-700 to-green-800;
}

.btn-danger {
    @apply bg-gradient-to-r from-red-500 via-red-600 to-red-700 text-white;
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

.btn-danger:hover {
    @apply from-red-600 via-red-700 to-red-800;
}

.btn-secondary {
    @apply bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-200;
}

.btn-secondary:hover {
    @apply bg-gray-300 dark:bg-gray-600;
}

.btn-ghost {
    @apply bg-transparent text-gray-600 dark:text-gray-400;
}

.btn-ghost:hover {
    @apply bg-gray-100 dark:bg-gray-800;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==========================================
   INPUTS MODERNOS COM FOCO ANIMADO
   ========================================== */

.input-modern {
    @apply w-full px-6 py-4 border-2 border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.input-modern:focus {
    @apply border-primary-500 outline-none;
    transform: scale(1.02);
    box-shadow: 
        0 0 0 4px rgba(59, 130, 246, 0.15),
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.input-modern:hover:not(:focus) {
    @apply border-gray-400 dark:border-gray-500;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.input-group {
    @apply mb-6;
    animation: fadeInUp 0.4s ease-out backwards;
}

.input-label {
    @apply block text-sm font-semibold text-gray-700 dark:text-gray-300 mb-2;
    transition: color 0.3s;
}

.input-group:focus-within .input-label {
    @apply text-primary-600 dark:text-primary-400;
    transform: translateX(4px);
}

.select-modern {
    @apply w-full px-6 py-4 border-2 border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white appearance-none cursor-pointer;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%233b82f6'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.5em 1.5em;
    padding-right: 3rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.select-modern:hover {
    @apply border-gray-400 dark:border-gray-500;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.select-modern:focus {
    @apply border-primary-500 outline-none;
    transform: scale(1.02);
    box-shadow: 
        0 0 0 4px rgba(59, 130, 246, 0.15),
        0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   TABELAS MODERNAS COM BORDAS ARREDONDADAS
   ========================================== */

.table-modern {
    @apply w-full bg-white dark:bg-gray-800 overflow-hidden;
    border-radius: 20px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.5s ease-out;
}

.dark .table-modern {
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.3),
        0 2px 4px -1px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.table-modern thead {
    @apply bg-gradient-to-r from-primary-500 via-primary-600 to-primary-700 text-white;
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

.table-modern th {
    @apply px-8 py-5 text-left text-xs font-bold uppercase tracking-wider;
    transition: background-color 0.3s;
}

.table-modern th:first-child {
    border-top-left-radius: 20px;
}

.table-modern th:last-child {
    border-top-right-radius: 20px;
}

.table-modern tbody tr {
    @apply border-b border-gray-200 dark:border-gray-700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: rowSlideIn 0.3s ease-out backwards;
}

.table-modern tbody tr:nth-child(even) {
    @apply bg-gray-50/50 dark:bg-gray-900/50;
}

.table-modern tbody tr:hover {
    @apply bg-gradient-to-r from-primary-50 via-purple-50/50 to-primary-50 dark:from-primary-900/20 dark:via-purple-900/10 dark:to-primary-900/20;
    transform: scale(1.005);
    box-shadow: 0 4px 12px -2px rgba(59, 130, 246, 0.15);
}

.table-modern tbody tr:last-child td:first-child {
    border-bottom-left-radius: 20px;
}

.table-modern tbody tr:last-child td:last-child {
    border-bottom-right-radius: 20px;
}

.table-modern td {
    @apply px-8 py-5 text-sm text-gray-900 dark:text-gray-100;
    transition: color 0.3s;
}

@keyframes rowSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================
   BADGES E STATUS COM PULSE E DESTAQUE
   ========================================== */

.badge {
    @apply inline-flex items-center px-4 py-2 text-xs font-bold;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    animation: badgePop 0.4s ease-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.badge::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.badge:hover::before {
    width: 200px;
    height: 200px;
}

.badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

@keyframes badgePop {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.badge-success {
    @apply bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200;
}

.badge-warning {
    @apply bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200;
}

.badge-danger {
    @apply bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200;
}

.badge-info {
    @apply bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200;
}

.badge-primary {
    @apply bg-primary-100 text-primary-800 dark:bg-primary-900 dark:text-primary-200;
}

/* ==========================================
   STATS CARDS ULTRA DESTACADOS
   ========================================== */

.stat-card {
    @apply bg-white dark:bg-gray-800;
    padding: 2rem; /* 32px - aumentado */
    border-radius: 24px;
    border: 2px solid transparent;
    position: relative;
    overflow: visible; /* Mudado para visible */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: statCardFloat 0.6s ease-out backwards;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
}

/* Background effect para stat-card sem overflow */
.stat-card-glow {
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
    z-index: 0;
}

.stat-card:hover .stat-card-glow {
    opacity: 1;
}

/* Conteúdo do stat-card acima do glow */
.stat-card > * {
    position: relative;
    z-index: 1;
}

.dark .stat-card {
    background: rgba(31, 41, 55, 0.95);
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.3),
        0 4px 6px -2px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

/* Removido - usando .stat-card-glow ao invés */

.stat-card:hover {
    transform: translateY(-12px) scale(1.03) rotate(0.5deg);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 10px 20px -5px rgba(0, 0, 0, 0.1),
        0 0 0 2px rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
}

.dark .stat-card:hover {
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 10px 20px -5px rgba(0, 0, 0, 0.3),
        0 0 0 2px rgba(59, 130, 246, 0.4);
}

.stat-icon {
    @apply w-14 h-14 flex items-center justify-center;
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: iconBounce 0.6s ease-out 0.2s backwards;
}

.stat-card:hover .stat-icon {
    transform: scale(1.25) rotate(8deg);
}

.stat-value {
    @apply text-3xl font-bold text-gray-900 dark:text-white;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: numberCount 0.8s ease-out;
}

.stat-label {
    @apply text-sm text-gray-500 dark:text-gray-400;
    animation: fadeIn 0.4s ease-out 0.3s backwards;
}

.stat-trend {
    @apply text-xs font-semibold;
    animation: fadeIn 0.4s ease-out 0.4s backwards;
}

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

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes numberCount {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================
   LOADING E SPINNERS ANIMADOS
   ========================================== */

.spinner {
    @apply inline-block w-8 h-8 border-4 border-gray-200 dark:border-gray-700 border-t-primary-500 rounded-full;
    animation: spin 0.8s linear infinite, pulse 2s ease-in-out infinite;
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-overlay {
    @apply fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-50;
    animation: fadeIn 0.3s ease-out;
}

.loading-content {
    @apply bg-white dark:bg-gray-800 rounded-2xl p-8 text-center shadow-2xl;
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================
   ALERTS COM BORDAS ARREDONDADAS E DESTAQUE
   ========================================== */

.alert {
    @apply px-8 py-5 mb-6 flex items-start gap-4;
    border-radius: 20px;
    border: 2px solid;
    animation: alertSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.alert::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: currentColor;
    border-radius: 20px 0 0 20px;
    animation: alertBar 0.4s ease-out;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes alertBar {
    from { height: 0; }
    to { height: 100%; }
}

.alert-success {
    @apply bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 text-green-800 dark:text-green-200;
}

.alert-error {
    @apply bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-800 dark:text-red-200;
}

.alert-warning {
    @apply bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 text-yellow-800 dark:text-yellow-200;
}

.alert-info {
    @apply bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 text-blue-800 dark:text-blue-200;
}

/* ==========================================
   ANIMAÇÕES GLOBAIS
   ========================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.4s ease-out;
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease-out;
}

.animate-fadeInDown {
    animation: fadeInDown 0.5s ease-out;
}

.animate-slideDown {
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slideUp {
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slideInLeft {
    animation: slideInLeft 0.5s ease-out;
}

.animate-slideInRight {
    animation: slideInRight 0.5s ease-out;
}

.animate-zoomIn {
    animation: zoomIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stagger animation delays */
.animate-delay-100 { animation-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-400 { animation-delay: 0.4s; }
.animate-delay-500 { animation-delay: 0.5s; }

/* ==========================================
   SCROLLBAR PADRÃO DO SISTEMA
   ========================================== */

/* Garantir que a scrollbar padrão apareça */
html, body {
    scrollbar-width: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* Manter scrollbar padrão do navegador - removendo customizações */
/* Para usar scrollbar padrão, removemos as customizações webkit */
/* A scrollbar padrão do sistema aparecerá automaticamente */

/* ==========================================
   UTILITIES PREMIUM
   ========================================== */

.text-gradient {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
    background-size: 200% 200%;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass-effect {
    background: rgba(31, 41, 55, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Line clamp para textos longos */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Break words para textos longos */
.break-words {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.shadow-soft {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s;
}

.shadow-soft:hover {
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
}

.dark .shadow-soft {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.dark .shadow-soft:hover {
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

/* ==========================================
   HOVER EFFECTS ESPECIAIS
   ========================================== */

.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-glow {
    transition: box-shadow 0.3s;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ==========================================
   RESPONSIVIDADE
   ========================================== */

@media (max-width: 1024px) {
    aside {
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    aside.mobile-open {
        transform: translateX(0);
    }
    
    .modern-card {
        border-radius: 1rem;
    }
    
    .btn-modern {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
}

/* ==========================================
   MODAIS E DROPDOWNS ARREDONDADOS
   ========================================== */

.modal-backdrop {
    @apply fixed inset-0 bg-black/60 z-40;
    backdrop-filter: blur(12px);
}

.modal-content {
    @apply bg-white dark:bg-gray-800 max-w-2xl w-full mx-auto my-8 p-10;
    border-radius: 28px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.dropdown-menu {
    @apply absolute right-0 mt-2 w-64 bg-white dark:bg-gray-800 py-3 z-50;
    border-radius: 20px;
    border: 2px solid rgba(0, 0, 0, 0.05);
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.dark .dropdown-menu {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.3),
        0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

.dropdown-item {
    @apply flex items-center px-5 py-3 text-sm text-gray-700 dark:text-gray-200 transition-all cursor-pointer;
    border-radius: 14px;
    margin: 0 8px;
}

.dropdown-item:hover {
    @apply bg-gradient-to-r from-primary-50 to-purple-50 dark:from-primary-900/20 dark:to-purple-900/20;
    transform: translateX(4px);
}

/* ==========================================
   DATATABLES CUSTOMIZATION ARREDONDADAS
   ========================================== */

.dataTables_wrapper {
    @apply p-8;
    animation: fadeIn 0.5s ease-out;
    border-radius: 24px;
}

.dataTables_filter input {
    @apply input-modern;
}

.dataTables_length select {
    @apply select-modern;
}

.dataTable {
    @apply table-modern;
}

.dataTables_paginate .paginate_button {
    @apply px-5 py-2.5 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-200 mx-1;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.dataTables_paginate .paginate_button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.dataTables_paginate .paginate_button:hover::before {
    width: 200px;
    height: 200px;
}

.dataTables_paginate .paginate_button:hover {
    @apply bg-primary-500 text-white;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.dataTables_paginate .paginate_button.current {
    @apply bg-gradient-to-r from-primary-500 to-primary-600 text-white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.4);
}

/* ==========================================
   FLATPICKR CUSTOMIZATION ARREDONDADO
   ========================================== */

.flatpickr-calendar {
    border-radius: 24px;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 0;
    animation: zoomIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.flatpickr-day {
    border-radius: 10px;
    transition: all 0.2s;
}

.flatpickr-day.selected {
    @apply bg-gradient-to-br from-primary-500 to-primary-600;
    border-color: transparent;
    animation: badgePop 0.3s ease-out;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.4);
}

.flatpickr-day.selected:hover {
    @apply bg-gradient-to-br from-primary-600 to-primary-700;
    transform: scale(1.15);
}

.flatpickr-day:hover {
    transform: scale(1.1);
    @apply bg-primary-50 dark:bg-primary-900/30;
    border-radius: 10px;
}

/* ==========================================
   MELHORIAS DE VISUALIZAÇÃO
   ========================================== */

/* Garantir que textos longos não sejam cortados */
.modern-card table td {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal !important;
    max-width: 300px; /* Limite máximo para quebrar */
}

/* Melhorar visualização de valores monetários */
.valor-monetario {
    @apply font-mono font-bold;
    white-space: nowrap;
}

/* Container com scroll horizontal suave em tabelas grandes */
.table-container {
    overflow-x: auto;
    border-radius: 20px;
    -webkit-overflow-scrolling: touch;
}

.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: transparent;
}

.table-container::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
    aside, header, .no-print {
        display: none !important;
    }
    
    main.content {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .modern-card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}
