/* Componente Global: Menu de Navegação com Cards
 * Uso: Menus com botões em grid (Financial Manager, My Account, etc)
 * Classes base: .nav-cards-*
 */

.nav-cards-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    margin: var(--spacing-sm) auto;
}

.nav-cards-header h1 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-normal);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
}

.nav-cards-header h1 a {
    color: inherit;
    text-decoration: none;
}

.nav-cards-header h1 a:hover {
    color: var(--color-text-muted);
}

.nav-cards-header p {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.nav-cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.nav-card-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-sm);
    min-width: 90px;
    background: var(--color-bg-body);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius-xs);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    color: var(--color-text-secondary);
    position: relative;
}

/* Link com estilo de botão - para elementos que redirecionam */
a.nav-card-btn.nav-card-link {
    text-decoration: none;
}

a.nav-card-btn.nav-card-link:hover {
    text-decoration: none;
}

.nav-card-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--spacing-xs);
    background: linear-gradient(90deg, var(--color-success), var(--color-success-light));
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.nav-card-btn:hover {
    border-color: var(--color-success);
    box-shadow: var(--shadow-md);
    transform: translateY(calc(-1 * var(--spacing-xs)));
}

.nav-card-btn:hover::before {
    transform: scaleX(1);
}

.nav-card-btn.active {
    border-color: var(--color-success);
    background: linear-gradient(135deg, var(--color-success-lighter) 0%, var(--color-bg-body) 100%);
    box-shadow: var(--shadow-lg);
}

.nav-card-btn.active::before {
    transform: scaleX(1);
}

.nav-card-btn i {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-xs);
    color: var(--color-text-muted);
    transition: all var(--transition-base);
}

.nav-card-btn:hover i,
.nav-card-btn.active i {
    color: var(--color-success);
    transform: scale(1.1);
}

.nav-card-btn span {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-normal);
    text-align: center;
}

.nav-cards-content {
    background: var(--color-bg-body);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius-xs);
    padding: var(--spacing-md);
    min-height: 300px;
}

.nav-cards-content .loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.nav-cards-content .spinner-border {
    width: var(--spacing-2xl);
    height: var(--spacing-2xl);
    border: var(--border-width-md) solid var(--color-bg-tertiary);
    border-top-color: var(--color-text-secondary);
}

/* Responsivo */
@media (max-width: 768px) {
    .nav-cards-grid {
        justify-content: center;
    }
    
    .nav-card-btn {
        padding: var(--spacing-sm) var(--spacing-sm);
        min-width: 120px;
    }
    
    .nav-card-btn i {
        font-size: var(--font-size-xl);
    }
    
    .nav-card-btn span {
        font-size: var(--font-size-sm);
    }
}

/* Dark Mode */
:root[class*="dark"] .nav-card-btn {
    background: var(--color-dark-bg);
    border-color: var(--color-dark-border);
    color: var(--color-dark-text);
}

:root[class*="dark"] .nav-card-btn:hover {
    border-color: var(--color-text-muted);
}

:root[class*="dark"] .nav-card-btn.active {
    border-color: var(--color-border-light);
    background: var(--color-dark-bg-hover);
}

:root[class*="dark"] .nav-card-btn i {
    color: var(--color-dark-text);
}

:root[class*="dark"] .nav-cards-content {
    background: var(--color-dark-bg);
    border-color: var(--color-dark-border);
    color: var(--color-dark-text);
}

:root[class*="dark"] .nav-cards-header h1 {
    color: var(--color-dark-text);
}

:root[class*="dark"] .nav-cards-header p {
    color: var(--color-dark-text-muted);
}

/* =================================================================
 * PADRÃO GLOBAL - Seções de Conteúdo (My Account, etc)
 * ================================================================= */

.my-account-section {
    max-width: var(--max-width-form);
    margin: 0 auto;
    padding: var(--spacing-xl);
    background: var(--color-bg-body);
    border-radius: var(--border-radius-sm);
}

.my-account-section h2 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-sm);
    border-bottom: var(--border-width-md) solid var(--color-bg-tertiary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    position: relative;
}

.my-account-section h2::after {
    content: '';
    position: absolute;
    bottom: calc(-1 * var(--spacing-xs));
    left: 0;
    width: 60px;
    height: var(--border-width-md);
    background: linear-gradient(90deg, var(--color-success), var(--color-success-light));
}

.my-account-section h2 i {
    font-size: var(--font-size-xl);
    color: var(--color-success);
}

.my-account-section p {
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* =================================================================
 * PADRÃO GLOBAL - Formulários
 * ================================================================= */

form {
    background: var(--color-bg-tertiary);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-sm);
    border: var(--border-width) solid var(--color-border);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-primary);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--color-text-primary);
    background-color: var(--color-bg-body);
    border: var(--border-width-md) solid var(--color-border);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.form-control:hover {
    border-color: var(--color-border-light);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-success);
    box-shadow: var(--shadow-focus-success);
}

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--color-bg-tertiary);
    cursor: not-allowed;
}

.form-text {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.invalid-feedback {
    display: none;
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--color-danger);
}

.invalid-feedback.d-block {
    display: block;
}

.form-control.is-invalid {
    border-color: var(--color-danger);
}

/* =================================================================
 * PADRÃO GLOBAL - Botões
 * ================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    border: var(--border-width) solid transparent;
    border-radius: var(--border-radius-xs);
    cursor: pointer;
    /* REMOVIDO: background verde padrão - deixar Bootstrap/botao.css controlar */
    /* background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-light) 100%); */
    /* border-color: transparent; */
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
}

.btn-primary:hover:not(:disabled) {
    /* REMOVIDO: hover verde - deixar Bootstrap controlar */
    /* background: linear-gradient(135deg, var(--color-success-dark) 0%, var(--color-success) 100%); */
    box-shadow: var(--shadow-lg);
    transform: translateY(calc(-1 * var(--spacing-xs) / 2));
}

.btn-secondary {
    color: var(--color-text-muted);
    background-color: var(--color-bg-tertiary);
    border-color: var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--color-border);
    border-color: var(--color-border-light);
    color: var(--color-text-secondary);
}

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

.btn-danger:hover:not(:disabled) {
    background-color: var(--color-danger-dark);
    border-color: var(--color-danger-dark);
}

.btn i {
    font-size: var(--font-size-sm);
}

.d-flex {
    display: flex;
}

.gap-2 {
    gap: var(--spacing-sm);
}

/* =================================================================
 * PADRÃO GLOBAL - Alertas (Messages do Django)
 * ================================================================= */

.alert {
    position: relative;
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-md);
    background: linear-gradient(135deg, var(--color-success-lighter) 0%, var(--color-success-light) 100%);
    border-color: var(--color-success-border);
    border-left: var(--border-width-lg) solid var(--color-success);
}

.alert-danger,
.alert-error {
    color: var(--color-danger-dark);
    background: linear-gradient(135deg, var(--color-danger-lighter) 0%, var(--color-danger-light) 100%);
    border-color: var(--color-danger-border);
    border-left: var(--border-width-lg) solid var(--color-danger);
}

.alert-warning {
    color: var(--color-warning-dark);
    background: linear-gradient(135deg, var(--color-warning-lighter) 0%, var(--color-warning-light) 100%);
    border-color: var(--color-warning-border);
    border-left: var(--border-width-lg) solid var(--color-warning);
}

.alert-info {
    color: var(--color-info-dark);
    background: linear-gradient(135deg, var(--color-info-lighter) 0%, var(--color-info-light) 100%);
    border-color: var(--color-info-border);
    border-left: var(--border-width-lg) solid var(--color-info);
}

.alert-dismissible {
    padding-right: var(--spacing-2xl);
}

.btn-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem;
    background: transparent;
    border: none;
    opacity: 0.5;
    cursor: pointer;
    font-size: var(--font-size-lg);
    line-height: 1;
    color: inherit;
}

.btn-close:hover {
    opacity: 1;
}

.btn-close::before {
    content: "×";
}

.fade {
    transition: opacity 0.15s linear;
}

.show {
    opacity: 1;
}

/* =================================================================
 * PADRÃO GLOBAL - Utilitários Responsivos
 * ================================================================= */

.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.5rem;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-3 {
    margin-top: 1rem;
}

/* =================================================================
 * PADRÃO GLOBAL - Security Cards
 * ================================================================= */

.security-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.security-card {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: var(--border-width-md) solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.security-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--border-width-lg);
    background: linear-gradient(90deg, var(--color-success), var(--color-success-light));
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.security-card:hover {
    border-color: var(--color-success);
    box-shadow: var(--shadow-xl);
    transform: translateY(calc(-1 * var(--spacing-xs)));
}

.security-card:hover::before {
    transform: scaleX(1);
}

.security-card i {
    color: var(--color-success);
    margin-bottom: var(--spacing-md);
}

.security-card h3 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin: 0 0 var(--spacing-sm) 0;
}

.security-card p {
    font-size: var(--font-size-sm);
    color: #666;
    margin: 0 0 1.5rem 0;
}

.password-change-form {
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

/* =================================================================
 * PADRÃO GLOBAL - Conteúdo das Seções (Home, Perfil, etc)
 * ================================================================= */

/* Home - Welcome Message */
.welcome-message {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border-left: 4px solid #10B981;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.welcome-message h3 {
    color: #065F46;
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.welcome-message p {
    color: #047857;
    margin: 0;
}

/* Home - Quick Stats Cards */
.quick-stats-account {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card-account {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card-account::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #059669, #10B981);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.stat-card-account:hover {
    border-color: #10B981;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.15);
    transform: translateY(-4px);
}

.stat-card-account:hover::before {
    transform: scaleY(1);
}

.stat-card-account i {
    color: #10B981;
    opacity: 0.8;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: var(--font-size-sm);
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: var(--font-size-md);
    color: #1f2937;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* Home - Quick Actions */
.quick-actions-account {
    margin-top: 2rem;
}

.quick-actions-account h3 {
    font-size: var(--font-size-lg);
    color: #1f2937;
    margin-bottom: 1rem;
    font-weight: 600;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.action-btn-account {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn-account:hover {
    border-color: #10B981;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.15);
    transform: translateY(-3px);
}

.action-btn-account i {
    font-size: var(--font-size-h3);
    color: #059669;
}

.action-btn-account span {
    font-size: var(--font-size-base);
    color: #374151;
    font-weight: 500;
}

/* Perfil - Profile Info */
.profile-info {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
}

.profile-avatar {
    flex-shrink: 0;
}

.profile-avatar i {
    color: #10B981;
}

.profile-details {
    flex: 1;
}

.detail-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    font-weight: 600;
    color: #6b7280;
    min-width: 150px;
    font-size: var(--font-size-base);
}

.detail-row .value {
    color: #1f2937;
    font-size: var(--font-size-base);
}

/* =================================================================
 * PADRÃO GLOBAL - Tema/Aparência
 * ================================================================= */

.theme-selector {
    margin-top: 2rem;
}

.theme-selector h3 {
    font-size: var(--font-size-lg);
    color: #1f2937;
    margin-bottom: 2rem;
    font-weight: 600;
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.theme-preview {
    width: 180px;
    height: 180px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid #e5e7eb;
    position: relative;
    overflow: hidden;
}

.theme-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(16, 185, 129, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-preview:hover::before {
    opacity: 1;
}

.theme-preview:hover {
    border-color: #10B981;
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.2);
    transform: translateY(-8px);
}

.theme-light {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
}

.theme-light i {
    color: #F59E0B;
}

.theme-dark {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.theme-dark i {
    color: #60A5FA;
}

.theme-auto {
    background: linear-gradient(135deg, #ffffff 0%, #1f2937 100%);
}

.theme-auto i {
    color: #10B981;
}

.theme-option h4 {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.theme-option .btn {
    min-width: 140px;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    background: #ffffff;
    color: #059669;
    border: 2px solid #10B981;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.theme-option .btn:hover {
    background: linear-gradient(135deg, #059669 0%, #10B981 100%);
    color: #ffffff;
    border-color: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

.current-theme {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border-left: 4px solid #10B981;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.current-theme p {
    margin: 0;
    color: #065F46;
    font-size: var(--font-size-base);
}

.current-theme strong {
    color: #047857;
}

/* Responsivo - Tema */
@media (max-width: 768px) {
    .theme-options {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .theme-preview {
        width: 150px;
        height: 150px;
    }
}

/* =================================================================
 * PADRÃO GLOBAL - Histórico de Acessos
 * ================================================================= */

.access-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.access-history-table thead {
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
}

.access-history-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1a1a1a;
}

.access-history-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: var(--font-size-base);
    color: #333;
}

.access-history-table tbody tr:hover {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    color: #065F46;
    border: 1px solid #6EE7B7;
}

.access-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.access-badge.success {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    color: #065F46;
    border: 1px solid #6EE7B7;
}

.access-badge.danger {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.access-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f5f5f5;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.access-stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.access-stat-item i {
    font-size: var(--font-size-xl);
}

.access-stat-item.success i {
    color: #10B981;
}

.access-stat-item.danger i {
    color: #EF4444;
}

.access-stat-item.danger i {
    color: #dc3545;
}

.access-stat-label {
    font-size: var(--font-size-sm);
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.access-stat-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: #1a1a1a;
}

.user-agent-text {
    font-family: 'Courier New', monospace;
    font-size: var(--font-size-sm);
    color: #666;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .access-history-table {
        font-size: 0.85rem;
    }
    
    .access-history-table th,
    .access-history-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .user-agent-text {
        max-width: 150px;
    }
}

@media (max-width: 768px) {
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .my-account-section {
        padding: 1rem;
    }
    
    .my-account-section h2 {
        font-size: 1.25rem;
    }
}

/* =================================================================
 * DARK MODE - Seções e Formulários
 * ================================================================= */

:root[class*="dark"] .my-account-section h2 {
    color: #e0e0e0;
}

:root[class*="dark"] .my-account-section h2 i {
    color: #e0e0e0;
}

:root[class*="dark"] .my-account-section p {
    color: #b0b0b0;
}

:root[class*="dark"] .form-label {
    color: #e0e0e0;
}

:root[class*="dark"] .form-control {
    color: #e0e0e0;
    background-color: #2d2d2d;
    border-color: #444;
}

:root[class*="dark"] .form-control:focus {
    border-color: #666;
}

:root[class*="dark"] .form-control:disabled,
:root[class*="dark"] .form-control[readonly] {
    background-color: #1a1a1a;
}

:root[class*="dark"] .form-text {
    color: #b0b0b0;
}

:root[class*="dark"] .btn-primary {
    color: #fff;
    background-color: #555;
    border-color: #555;
}

:root[class*="dark"] .btn-primary:hover:not(:disabled) {
    background-color: #666;
    border-color: #666;
}

:root[class*="dark"] .btn-secondary {
    color: #e0e0e0;
    background-color: #3d3d3d;
    border-color: #555;
}

:root[class*="dark"] .btn-secondary:hover:not(:disabled) {
    background-color: #4d4d4d;
    border-color: #666;
}

/* Dark Mode - Histórico de Acessos */
:root[class*="dark"] .access-history-table {
    background: #2d2d2d;
}

:root[class*="dark"] .access-history-table thead {
    background: #1a1a1a;
    border-bottom-color: #444;
}

:root[class*="dark"] .access-history-table th {
    color: #e0e0e0;
}

:root[class*="dark"] .access-history-table td {
    border-bottom-color: #3d3d3d;
    color: #e0e0e0;
}

:root[class*="dark"] .access-history-table tbody tr:hover {
    background: #3d3d3d;
}

:root[class*="dark"] .access-stats {
    background: #2d2d2d;
    border-color: #444;
}

:root[class*="dark"] .access-stat-label {
    color: #b0b0b0;
}

:root[class*="dark"] .access-stat-value {
    color: #e0e0e0;
}

:root[class*="dark"] .user-agent-text {
    color: #b0b0b0;
}

:root[class*="dark"] code {
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 0.25rem 0.5rem;
    border-radius: 2px;
}

/* ============================================================================
   INPUTS, SELECT E TEXTAREA - ESTILOS GLOBAIS
   ============================================================================ */

/* Inputs de texto */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="time"],
textarea,
select,
.form-control,
.form-select {
    border: 1px solid #d1d5db !important;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: var(--font-size-sm);
    transition: all 0.15s ease-in-out;
    background-color: #ffffff;
}

/* Flatpickr input */
.flatpickr-input {
    border: 1px solid #d1d5db !important;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: var(--font-size-sm);
    transition: all 0.15s ease-in-out;
    background-color: #ffffff;
}

/* Focus state */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="month"]:focus,
input[type="week"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus,
.form-control:focus,
.form-select:focus,
.flatpickr-input:focus {
    border-color: #4e73df !important;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.15) !important;
    outline: none;
}

/* Hover state */
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="tel"]:hover,
input[type="url"]:hover,
input[type="search"]:hover,
input[type="date"]:hover,
input[type="datetime-local"]:hover,
input[type="month"]:hover,
input[type="week"]:hover,
input[type="time"]:hover,
textarea:hover,
select:hover,
.form-control:hover,
.form-select:hover,
.flatpickr-input:hover {
    border-color: #9ca3af !important;
}

/* Disabled state */
input[type="text"]:disabled,
input[type="email"]:disabled,
input[type="password"]:disabled,
input[type="number"]:disabled,
input[type="tel"]:disabled,
input[type="url"]:disabled,
input[type="search"]:disabled,
input[type="date"]:disabled,
input[type="datetime-local"]:disabled,
input[type="month"]:disabled,
input[type="week"]:disabled,
input[type="time"]:disabled,
textarea:disabled,
select:disabled,
.form-control:disabled,
.form-select:disabled {
    background-color: #f3f4f6;
    border-color: #e5e7eb !important;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Invalid/Error state */
input[type="text"].is-invalid,
input[type="email"].is-invalid,
input[type="password"].is-invalid,
input[type="number"].is-invalid,
input[type="tel"].is-invalid,
input[type="url"].is-invalid,
input[type="search"].is-invalid,
input[type="date"].is-invalid,
input[type="datetime-local"].is-invalid,
input[type="month"].is-invalid,
input[type="week"].is-invalid,
input[type="time"].is-invalid,
textarea.is-invalid,
select.is-invalid,
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545 !important;
}

input[type="text"].is-invalid:focus,
input[type="email"].is-invalid:focus,
input[type="password"].is-invalid:focus,
input[type="number"].is-invalid:focus,
input[type="tel"].is-invalid:focus,
input[type="url"].is-invalid:focus,
input[type="search"].is-invalid:focus,
input[type="date"].is-invalid:focus,
input[type="datetime-local"].is-invalid:focus,
input[type="month"].is-invalid:focus,
input[type="week"].is-invalid:focus,
input[type="time"].is-invalid:focus,
textarea.is-invalid:focus,
select.is-invalid:focus,
.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15) !important;
}

/* Dark mode support */
:root[class*="dark"] input[type="text"],
:root[class*="dark"] input[type="email"],
:root[class*="dark"] input[type="password"],
:root[class*="dark"] input[type="number"],
:root[class*="dark"] input[type="tel"],
:root[class*="dark"] input[type="url"],
:root[class*="dark"] input[type="search"],
:root[class*="dark"] input[type="date"],
:root[class*="dark"] input[type="datetime-local"],
:root[class*="dark"] input[type="month"],
:root[class*="dark"] input[type="week"],
:root[class*="dark"] input[type="time"],
:root[class*="dark"] textarea,
:root[class*="dark"] select,
:root[class*="dark"] .form-control,
:root[class*="dark"] .form-select,
:root[class*="dark"] .flatpickr-input {
    background-color: #2d2d2d;
    border-color: #444 !important;
    color: #e0e0e0;
}

:root[class*="dark"] input[type="text"]:focus,
:root[class*="dark"] input[type="email"]:focus,
:root[class*="dark"] input[type="password"]:focus,
:root[class*="dark"] input[type="number"]:focus,
:root[class*="dark"] input[type="tel"]:focus,
:root[class*="dark"] input[type="url"]:focus,
:root[class*="dark"] input[type="search"]:focus,
:root[class*="dark"] input[type="date"]:focus,
:root[class*="dark"] input[type="datetime-local"]:focus,
:root[class*="dark"] input[type="month"]:focus,
:root[class*="dark"] input[type="week"]:focus,
:root[class*="dark"] input[type="time"]:focus,
:root[class*="dark"] textarea:focus,
:root[class*="dark"] select:focus,
:root[class*="dark"] .form-control:focus,
:root[class*="dark"] .form-select:focus,
:root[class*="dark"] .flatpickr-input:focus {
    border-color: #5a8fd3 !important;
    box-shadow: 0 0 0 0.2rem rgba(90, 143, 211, 0.25) !important;
}
