@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-gradient-start: #f8fafc;
    --bg-gradient-end: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.8);
    --text-main: #1e293b;
    --text-muted: #475569;
    --error-color: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
}

html {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end), var(--bg-gradient-start));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, rgba(255,255,255,0) 70%);
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(236,72,153,0.05) 0%, rgba(255,255,255,0) 70%);
    z-index: -1;
}

/* Layout specífico para login */
body.login-layout {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Glassmorphism Card Utils */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.glass-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 100px;
    height: 100px;
    background: var(--primary-color);
    filter: blur(60px);
    z-index: -1;
    opacity: 0.5;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* Button */
.btn,
.btn-nav {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: white !important;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.btn {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
}

.btn-nav {
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn:hover,
.btn-nav:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

.btn:active,
.btn-nav:active {
    transform: scale(0.98);
}

/* Dashboard Layout */
.navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 100px;
    margin: 1.5rem 2rem;
    padding: 1rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 1.5rem;
    z-index: 50;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.logo {
    font-weight: 800;
    /* Bolder font */
    font-size: 1.5rem;
    background: linear-gradient(to right, #4f46e5, #ec4899);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    /* More space between name and logout */
}

.user-menu span {
    color: var(--text-main);
    /* Brighter text for username */
    font-weight: 500;
}

.dashboard-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Table Styles */
.table-container {
    overflow-x: hidden;
    width: 100%;
}

.data-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    color: var(--text-main);
    table-layout: auto;
}

.data-table th,
.data-table td {
    padding: 1.25rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.data-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.data-table th {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0, 0, 0, 0.02);
}

.data-table tbody tr {
    transition: all 0.3s ease;
}

.data-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.05) !important;
    transform: scale(1.002);
    box-shadow: inset 4px 0 0 var(--primary-color);
}

/* Chips/Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-pending {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
}

.badge-solved {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.badge-product {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.badge-win {
    background: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
}

.badge-next {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
}

.badge-high {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-medium {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge-low {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}

.badge-new {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 800px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-overlay.active .modal {
    transform: none;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.file-drop-area {
    border: 2px dashed var(--glass-border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    margin-bottom: 1rem;
}

.file-drop-area:hover {
    border-color: var(--primary-color);
}

/* Utils */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

/* User Grid Layout */
.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.user-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.user-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary-color);
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.user-role-badge {
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.user-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    width: 100%;
}

.user-actions .btn {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.5rem;
}

.text-sm {
    font-size: 0.875rem;
}

.error-msg {
    color: var(--error-color);
    text-align: center;
    margin-bottom: 1rem;
    background: rgba(239, 68, 68, 0.1);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
}

/* Filters & Search Bar Styling */
.filters-wrapper {
    flex-grow: 1;
    margin: 0 2rem;
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.7);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    padding-right: 1rem;
    border-right: 1px solid var(--glass-border);
}

.filter-group:last-of-type {
    border-right: none;
    padding-right: 0;
}

/* Custom Selects */
.select-container {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.filter-select:hover {
    background: rgba(255, 255, 255, 0.05);
}

.filter-select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
}

.data-table tbody tr {
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.2s;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
    transform: scale(1.002);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.filter-select option {
    background: #ffffff;
    color: var(--text-main);
    padding: 0.5rem;
}

.select-icon {
    position: absolute;
    right: 0.75rem;
    pointer-events: none;
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* Date Inputs */
.date-group {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.date-group:focus-within {
    border-color: var(--primary-color);
}

.filter-date {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0.25rem;
}

.filter-date::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
}

.filter-date:focus {
    outline: none;
    color: var(--text-main);
}

.date-separator {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0 0.25rem;
}

/* Search Group */
.search-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    border: 1px solid transparent;
    transition: all 0.2s;
    flex-grow: 1;
    min-width: 200px;
}

.search-group:focus-within {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.8);
}

.search-input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.9rem;
    width: 100%;
    padding: 0.4rem;
}

.search-input option {
    background: #ffffff;
    color: var(--text-main);
}

.search-input:focus {
    outline: none;
}

.search-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.search-btn:hover {
    color: var(--primary-color);
}

/* Reset Button */
.btn-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
    transition: all 0.2s;
}

.btn-reset:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.05);
}

@media (max-width: 1024px) {
    .filters-wrapper {
        margin: 1rem 0;
        width: 100%;
        max-width: none;
    }

    .filter-group {
        border-right: none;
        flex-grow: 1;
    }

    .filters-form {
        gap: 0.5rem;
    }
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.pagination-btn:hover:not(.disabled) {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Global Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-content {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Navigation Links Refinement */
.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    position: relative;
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(79, 70, 229, 0.05);
}

.nav-link.active {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -2px 10px var(--primary-color);
}

/* User Profile Link in Navbar */
.user-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s;
    color: var(--text-muted);
}

.user-link .avatar-mini {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: white;
    font-weight: 700;
}

.user-link:hover {
    background: rgba(79, 70, 229, 0.05);
    color: var(--text-main);
}

.user-link.active {
    background: rgba(79, 70, 229, 0.1);
    color: var(--text-main);
}

.navbar-separator {
    width: 1px;
    height: 24px;
    background: var(--glass-border);
    margin: 0 1rem;
}

/* Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: max-content;
    max-width: 200px;
    background-color: #1e293b;
    color: var(--text-main);
    text-align: center;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    font-size: 0.75rem;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Loading Skeleton */
.loading-skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    height: 20px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.breadcrumbs span {
    color: var(--text-main);
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 120px;
    height: 120px;
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.empty-state p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Sortable Column Indicator */
.sortable {
    user-select: none;
}

.sortable:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ADDED: Compact Icon Text Button */
.btn-icon-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: white;
    transition: all 0.2s;
    line-height: 1;
}

.btn-icon-text:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-icon-text svg {
    width: 16px;
    height: 16px;
    opacity: 0.9;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: #ffffff;
    backdrop-filter: blur(12px);
    border: 1px solid #e2e8f0;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 0.5rem 0;
    z-index: 100;
    top: 100%;
    left: 0;
    overflow: hidden;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.dropdown-content a:hover {
    background: rgba(79, 70, 229, 0.05);
    color: var(--primary-color);
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.dropdown:hover .nav-link.dropbtn {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}