/* ========================================
   Sistema de Design Refinado & Sofisticado
   Inspirado em princípios de Luxury/Refined Design
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@600;700&display=swap');

:root {
    /* Paleta de Cores Refinada */
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-primary-light: #eef2ff;
    --color-primary-dark: #4338ca;
    
    /* Neutros Sofisticados */
    --color-bg: #ffffff;
    --color-bg-secondary: #fafbfc;
    --color-bg-tertiary: #f1f3f5;
    --color-bg-elevated: #ffffff;
    --color-border: #e1e4e8;
    --color-border-hover: #d0d7de;
    --color-border-subtle: #f6f8fa;
    
    /* Texto Hierárquico */
    --color-text-primary: #0d1117;
    --color-text-secondary: #656d76;
    --color-text-tertiary: #8b949e;
    --color-text-muted: #b1bac4;
    
    /* Estados Refinados */
    --color-success: #1a7f37;
    --color-success-light: #dafbe1;
    --color-success-dark: #137333;
    --color-warning: #d1242f;
    --color-warning-light: #ffebe9;
    --color-warning-dark: #b62324;
    --color-danger: #cf222e;
    --color-danger-light: #ffebe9;
    --color-danger-dark: #a40e26;
    --color-info: #0969da;
    --color-info-light: #ddf4ff;
    --color-info-dark: #0550ae;
    
    /* Espaçamentos Harmoniosos */
    --space-xs: 0.375rem;
    --space-sm: 0.5rem;
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
    --space-3xl: 2.5rem;
    
    /* Bordas Elegantes */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.25rem;
    --radius-full: 9999px;
    
    /* Sombras Dramáticas */
    --shadow-xs: 0 1px 0 rgba(27, 31, 35, 0.04);
    --shadow-sm: 0 1px 3px rgba(27, 31, 35, 0.12), 0 1px 2px rgba(27, 31, 35, 0.24);
    --shadow-md: 0 3px 6px rgba(27, 31, 35, 0.15), 0 2px 4px rgba(27, 31, 35, 0.12);
    --shadow-lg: 0 10px 20px rgba(27, 31, 35, 0.19), 0 6px 6px rgba(27, 31, 35, 0.23);
    --shadow-xl: 0 15px 35px rgba(27, 31, 35, 0.25), 0 5px 15px rgba(27, 31, 35, 0.15);
    --shadow-glow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    
    /* Transições Elegantes */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Gradientes Sutis */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-bg: linear-gradient(135deg, #fafbfc 0%, #f1f3f5 100%);
    --gradient-overlay: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 100%);
}

/* ========================================
   Reset e Base Tipográfica
   ======================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Reset específico - não afeta Bootstrap */
body {
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6, p {
    margin: 0;
    padding: 0;
}

/* Não resetar listas para não quebrar Bootstrap */
ul:not(.sidebar-nav):not(.pagination):not(.dropdown-menu),
ol:not(.sidebar-nav):not(.pagination):not(.dropdown-menu) {
    margin: 0;
    padding: 0;
    list-style: none;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--color-bg-secondary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.03) 0px, transparent 50%);
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'kern' 1, 'liga' 1;
    text-rendering: optimizeLegibility;
}

/* ========================================
   Tipografia Distintiva
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', 'DM Sans', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text-primary);
    margin-bottom: var(--space-md);
    letter-spacing: -0.02em;
}

h1 { 
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

h2 { 
    font-size: 2rem;
    font-weight: 700;
}

h3 { 
    font-size: 1.5rem;
    font-weight: 600;
}

h4 { 
    font-size: 1.25rem;
    font-weight: 600;
}

h5 { 
    font-size: 1.125rem;
    font-weight: 600;
}

h6 { 
    font-size: 1rem;
    font-weight: 600;
}

p {
    margin-bottom: var(--space-md);
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ========================================
   Sidebar Refinada
   ======================================== */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 240px;
    background: var(--color-bg-elevated);
    border-right: 1px solid var(--color-border);
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition-base);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, var(--color-border) 50%, transparent 100%);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-3xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--color-border-subtle);
    position: relative;
}

.sidebar-logo::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

.sidebar-logo i {
    font-size: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.2));
}

.sidebar-logo h3 {
    font-size: 1.125rem;
    margin: 0;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-item {
    margin-bottom: var(--space-xs);
    position: relative;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    font-weight: 500;
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
}

.sidebar-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform var(--transition-base);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.sidebar-nav-link:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    transform: translateX(4px);
    padding-left: calc(var(--space-lg) + 4px);
}

.sidebar-nav-link:hover::before {
    transform: scaleY(1);
}

.sidebar-nav-link.active {
    background: linear-gradient(90deg, var(--color-primary-light) 0%, transparent 100%);
    color: var(--color-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.sidebar-nav-link.active::before {
    transform: scaleY(1);
}

.sidebar-nav-link i {
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
    transition: transform var(--transition-base);
}

.sidebar-nav-link:hover i {
    transform: scale(1.1);
}

.sidebar-footer {
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-border-subtle);
    margin-top: auto;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

.user-menu::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.user-menu:hover {
    background: var(--color-bg-tertiary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.8125rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 1;
    transition: transform var(--transition-bounce);
}

.user-menu:hover .user-avatar {
    transform: scale(1.05) rotate(5deg);
}

/* ========================================
   Main Content Area
   ======================================== */

.main-content {
    margin-left: 240px;
    min-height: 100vh;
    padding: var(--space-xl);
    animation: fadeInUp 0.6s ease-out;
}

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

.page-header {
    margin-bottom: var(--space-2xl);
    position: relative;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.03em;
}

.page-title i {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
}

.page-subtitle {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* ========================================
   Cards Modernos com Profundidade
   ======================================== */

.card-modern {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.card-modern:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--color-border-hover);
    transform: translateY(-2px);
}

.card-modern:hover::before {
    opacity: 1;
}

.card-modern-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border-subtle);
}

.card-modern-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.01em;
}

.card-modern-title i {
    color: var(--color-primary);
    font-size: 1.125rem;
}

/* ========================================
   Stat Cards com Animação
   ======================================== */

.stat-card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-primary);
}

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

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: var(--space-sm) 0;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card-label {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-xs);
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    margin-bottom: var(--space-md);
    position: relative;
    transition: all var(--transition-bounce);
}

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

.stat-card-icon.primary {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, rgba(99, 102, 241, 0.1) 100%);
    color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.stat-card-icon.success {
    background: linear-gradient(135deg, var(--color-success-light) 0%, rgba(26, 127, 55, 0.1) 100%);
    color: var(--color-success);
    box-shadow: 0 4px 12px rgba(26, 127, 55, 0.2);
}

.stat-card-icon.warning {
    background: linear-gradient(135deg, var(--color-warning-light) 0%, rgba(209, 36, 47, 0.1) 100%);
    color: var(--color-warning);
    box-shadow: 0 4px 12px rgba(209, 36, 47, 0.2);
}

.stat-card-icon.info {
    background: linear-gradient(135deg, var(--color-info-light) 0%, rgba(9, 105, 218, 0.1) 100%);
    color: var(--color-info);
    box-shadow: 0 4px 12px rgba(9, 105, 218, 0.2);
}

/* ========================================
   Botões Refinados
   ======================================== */

.btn-modern {
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    text-decoration: none;
    line-height: 1.5;
    position: relative;
    overflow: hidden;
    font-family: 'DM Sans', sans-serif;
}

.btn-modern::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn-modern:hover::before {
    opacity: 1;
}

.btn-modern-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-modern-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.05);
}

.btn-modern-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-modern-secondary {
    background: var(--color-bg-elevated);
    color: var(--color-text-primary);
    border: 1.5px solid var(--color-border);
    box-shadow: var(--shadow-xs);
}

.btn-modern-secondary:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-modern-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8125rem;
}

.btn-modern-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 0.9375rem;
}

/* ========================================
   Tabelas Elegantes
   ======================================== */

.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead {
    background: var(--color-bg-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-modern th {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    font-weight: 700;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-tertiary);
    border-bottom: 2px solid var(--color-border);
    font-family: 'Space Grotesk', sans-serif;
    vertical-align: middle;
}

/* Primeira coluna do cabeçalho também precisa do border para alinhar */
.table-modern th:first-child {
    border-left: 3px solid transparent;
}

.table-modern td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border-subtle);
    color: var(--color-text-primary);
    transition: background var(--transition-fast);
    white-space: normal;
    vertical-align: middle;
    position: relative;
    font-size: 0.875rem;
}


.table-modern tbody tr {
    transition: background var(--transition-fast);
    position: relative;
}

.table-modern tbody tr:hover {
    background: var(--color-bg-secondary);
}

/* Barra lateral no hover usando border-left na primeira célula */
.table-modern tbody tr td:first-child {
    border-left: 3px solid transparent;
    transition: border-left-color var(--transition-base);
    position: relative;
}

.table-modern tbody tr:hover td:first-child {
    border-left-color: var(--color-primary);
}

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


/* ========================================
   Badges Modernos
   ======================================== */

.badge-modern {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.02em;
    font-family: 'DM Sans', sans-serif;
}

.badge-modern-success {
    background: var(--color-success-light);
    color: var(--color-success-dark);
    box-shadow: 0 1px 2px rgba(26, 127, 55, 0.1);
}

.badge-modern-warning {
    background: var(--color-warning-light);
    color: var(--color-warning-dark);
    box-shadow: 0 1px 2px rgba(209, 36, 47, 0.1);
}

.badge-modern-info {
    background: var(--color-info-light);
    color: var(--color-info-dark);
    box-shadow: 0 1px 2px rgba(9, 105, 218, 0.1);
}

.badge-modern-danger {
    background: var(--color-danger-light);
    color: var(--color-danger-dark);
    box-shadow: 0 1px 2px rgba(207, 34, 46, 0.1);
}

.badge-modern-neutral {
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ========================================
   Formulários Refinados
   ======================================== */

.form-group-modern {
    margin-bottom: var(--space-lg);
}

.form-label-modern {
    display: block;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--color-text-primary);
    margin-bottom: var(--space-xs);
    letter-spacing: 0.01em;
    font-family: 'DM Sans', sans-serif;
}

.form-control-modern {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all var(--transition-base);
    background: var(--color-bg-elevated);
    color: var(--color-text-primary);
    font-family: 'DM Sans', sans-serif;
}

.form-control-modern:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
    background: var(--color-bg);
}

.form-control-modern::placeholder {
    color: var(--color-text-tertiary);
}

.input-group-modern {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
}

.input-group-modern .input-icon {
    color: var(--color-text-tertiary);
    font-size: 1rem;
    transition: color var(--transition-base);
}

.input-group-modern:focus-within .input-icon {
    color: var(--color-primary);
}

/* ========================================
   Alerts Elegantes
   ======================================== */

.alert-modern {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1.5px solid;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    position: relative;
    overflow: hidden;
    animation: slideInRight 0.4s ease-out;
    font-size: 0.875rem;
}

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

.alert-modern::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}

.alert-modern-success {
    background: var(--color-success-light);
    border-color: var(--color-success);
    color: var(--color-success-dark);
}

.alert-modern-success::before {
    background: var(--color-success);
}

.alert-modern-danger {
    background: var(--color-danger-light);
    border-color: var(--color-danger);
    color: var(--color-danger-dark);
}

.alert-modern-danger::before {
    background: var(--color-danger);
}

.alert-modern-info {
    background: var(--color-info-light);
    border-color: var(--color-info);
    color: var(--color-info-dark);
}

.alert-modern-info::before {
    background: var(--color-info);
}

.alert-modern-warning {
    background: var(--color-warning-light);
    border-color: var(--color-warning);
    color: var(--color-warning-dark);
}

.alert-modern-warning::before {
    background: var(--color-warning);
}

/* ========================================
   Dropdown Menu Refinado
   ======================================== */

.dropdown-menu {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-sm);
    min-width: 220px;
    backdrop-filter: blur(10px);
    animation: fadeInDown 0.2s ease-out;
}

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

.dropdown-item {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-text-primary);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    transform: translateX(4px);
}

.dropdown-divider {
    margin: var(--space-sm) 0;
    border-top: 1px solid var(--color-border-subtle);
    opacity: 1;
}

/* ========================================
   Paginação Moderna
   ======================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: var(--space-xs);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-elevated);
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all var(--transition-base);
    cursor: pointer;
}

.pagination .page-link:hover:not(.disabled) {
    background: var(--color-bg-tertiary);
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.pagination .page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.pagination .page-item.disabled .page-link {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
    color: var(--color-text-tertiary);
    cursor: not-allowed;
    opacity: 0.5;
}

/* ========================================
   Modais Elegantes
   ======================================== */

.modal-content {
    border: none;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--color-border-subtle);
    padding: var(--space-xl);
    background: var(--color-bg-secondary);
}

.modal-title {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-text-primary);
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.01em;
}

.modal-body {
    padding: var(--space-xl);
}

.modal-footer {
    border-top: 1px solid var(--color-border-subtle);
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    background: var(--color-bg-secondary);
}

/* ========================================
   Login Page Refinada
   ======================================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.1) 0px, transparent 50%),
        var(--color-bg-secondary);
    padding: var(--space-xl);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.login-card {
    background: var(--color-bg-elevated);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-2xl);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    border: 1px solid var(--color-border);
    animation: fadeInScale 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.login-logo i {
    font-size: 3rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-md);
    display: inline-block;
    filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.2));
}

.login-title {
    font-size: 1.625rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    font-weight: 400;
}

.form-check-modern {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.form-check-input-modern {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--color-primary);
    border-radius: var(--radius-sm);
}

.form-check-label-modern {
    margin: 0;
    font-size: 0.9375rem;
    cursor: pointer;
    color: var(--color-text-secondary);
    font-weight: 500;
    user-select: none;
}

.btn-modern-full {
    width: 100%;
    justify-content: center;
}

.form-error {
    color: var(--color-danger);
    font-size: 0.875rem;
    margin-top: var(--space-sm);
    font-weight: 500;
}

.login-test-credentials {
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-border-subtle);
}

.test-credentials-card {
    background: var(--color-info-light);
    border: 1.5px solid var(--color-info);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
}

.test-credentials-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.test-credentials-header i {
    color: var(--color-info);
    font-size: 1.25rem;
}

.test-credentials-header strong {
    color: var(--color-info-dark);
    font-size: 0.9375rem;
    font-weight: 700;
}

.test-credentials-content {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.test-credential-item {
    margin-bottom: var(--space-md);
}

.test-credential-item:last-child {
    margin-bottom: 0;
}

.test-credential-item strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

.copyable-code {
    background: rgba(255, 255, 255, 0.8);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: var(--space-sm);
    font-family: 'DM Sans', monospace;
    font-weight: 600;
    color: var(--color-info-dark);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.copyable-code:hover {
    background: white;
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

.test-credentials-footer {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(9, 105, 218, 0.2);
}

.form-control-modern.is-invalid {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(207, 34, 46, 0.1);
}

/* ========================================
   Componentes do Dashboard
   ======================================== */

.chart-container {
    padding: var(--space-xl);
    position: relative;
}

.chart-container canvas {
    max-height: 400px;
}

.channel-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 500;
}

.channel-badge i {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.channel-woocommerce {
    color: #720eec;
}
.channel-woocommerce i {
    color: #720eec;
}
.channel-woocommerce span {
    color: #720eec;
}

.channel-amazon {
    color: #ff9900;
}
.channel-amazon i {
    color: #ff9900;
}
.channel-amazon span {
    color: #ff9900;
}

.channel-sellsy i,
.channel-sellsy span {
    color: var(--color-info);
}

.channel-generic i {
    color: var(--color-text-tertiary);
}

.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--color-text-tertiary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.4;
    display: block;
}

.empty-state p {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
}

.reference-code {
    background: var(--color-bg-secondary);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-family: 'DM Sans', monospace;
    font-weight: 600;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-subtle);
}

.pagination-wrapper {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.pagination-info {
    color: var(--color-text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ========================================
   Responsividade
   ======================================== */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 240px;
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }
    
    .main-content {
        margin-left: 0;
        padding: var(--space-md);
    }
    
    .page-title {
        font-size: 1.625rem;
    }
    
    .stat-card-value {
        font-size: 1.625rem;
    }
    
    .card-modern {
        padding: var(--space-lg);
    }
    
    h1 {
        font-size: 1.625rem;
    }
}

/* ========================================
   Utilitários
   ======================================== */

.text-muted-modern {
    color: var(--color-text-secondary);
}

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

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

.rounded-modern {
    border-radius: var(--radius-xl);
}

.transition-modern {
    transition: all var(--transition-base);
}

.gap-2 {
    gap: 0.5rem;
}

/* ========================================
   Correções para Tabelas e Layout
   ======================================== */

/* Garantir que tabelas responsivas funcionem */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive > .table-modern {
    margin-bottom: 0;
    width: 100%;
    table-layout: auto;
    min-width: 100%;
}

/* Evitar scroll horizontal desnecessário - ajustar conteúdo */
.table-responsive {
    overflow-x: visible;
    width: 100%;
}



@media (max-width: 1200px) {
    .table-responsive {
        overflow-x: auto;
    }
    
   
}

/* Garantir que células da tabela mantenham estrutura correta */
.table-modern {
    table-layout: auto;
    width: 100%;
}

.table-modern td,
.table-modern th {
    display: table-cell !important;
    vertical-align: middle;
    box-sizing: border-box;
}

/* Garantir que botões dentro de tabelas não quebrem layout */
.table-modern .btn-modern {
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    min-width: auto;
}

/* Garantir que elementos inline na tabela não quebrem */
.table-modern td > .channel-badge,
.table-modern td > .badge-modern,
.table-modern td > .reference-code {
    display: inline-flex;
    vertical-align: middle;
}

/* Garantir que a última coluna tenha espaço suficiente e não quebre */
.table-modern td:last-child,
.table-modern th:last-child {
    padding-right: var(--space-xl);
    min-width: 80px;
    max-width: 120px;
    overflow: visible;
}

/* Garantir que botões na última coluna não quebrem */
.table-modern td:last-child .btn-modern {
    width: auto;
    max-width: 100%;
}

/* Ações da tabela */
.table-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    align-items: center;
}

.table-actions .btn-modern {
    flex-shrink: 0;
}

/* Botão inline (para badges com botões) */
.btn-inline {
    margin-left: var(--space-sm);
    display: inline-flex;
}

/* Código de tipo */
.type-code {
    background: var(--color-bg-secondary);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-family: 'DM Sans', monospace;
    font-weight: 600;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-subtle);
}

/* Botão de perigo */
.btn-modern-danger {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border: 1px solid var(--color-danger-light);
}

.btn-modern-danger:hover {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

/* Header com ações */
.page-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

/* Garantir que colunas da tabela se ajustem */
.table-modern th,
.table-modern td {
    white-space: normal;
    word-wrap: break-word;
}

/* Coluna de ações deve ter largura fixa */
.table-modern th:last-child,
.table-modern td:last-child {
    white-space: nowrap;
    width: auto;
    min-width: 140px;
}

/* Coluna de integração API pode quebrar linha */
.table-modern td:nth-child(5) {
    white-space: normal;
    max-width: 200px;
}

/* Garantir que a tabela não ultrapasse o container */
.card-modern {
    overflow: hidden;
}

.card-modern > .table-responsive {
    max-width: 100%;
}

/* Garantir que células não quebrem o layout */
.table-modern td,
.table-modern th {
    overflow: visible;
    word-wrap: break-word;
}

/* ========================================
   Animações de Entrada
   ======================================== */

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

.stat-card {
    animation: staggerFadeIn 0.6s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* ========================================
   Componentes Adicionais
   ======================================== */

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-text-primary);
    margin-bottom: 0.125rem;
}

.user-email {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
