/**
 * LAUDO CONTROL - COMPONENTES PADRONIZADOS
 * Sistema de Design Unificado
 * @version 1.0
 */

/* ============================================
   VARIÁVEIS DO SISTEMA
   ============================================ */
:root {
    /* Cores Primárias */
    --primary: #2196f3;
    --primary-dark: #1565c0;
    --primary-light: #42a5f5;
    
    /* Cores de Status */
    --success: #4caf50;
    --success-dark: #2e7d32;
    --warning: #ff9800;
    --warning-dark: #f57c00;
    --error: #f44336;
    --error-dark: #d32f2f;
    --info: #00bcd4;
    --info-dark: #0097a7;
    
    /* Cores Neutras - Modo Claro */
    --bg-light: #f5f7fa;
    --card-light: #ffffff;
    --text-light: #2d3748;
    --text-muted-light: #718096;
    --border-light: #e2e8f0;
    
    /* Cores Neutras - Modo Escuro */
    --bg-dark: #1a202c;
    --card-dark: #2d3748;
    --text-dark: #e2e8f0;
    --text-muted-dark: #a0aec0;
    --border-dark: #4a5568;
    
    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.04);
    
    /* Espaçamentos */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Bordas */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Transições */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ============================================
   BOTÕES PADRONIZADOS
   ============================================ */

/* Botão Primário */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
    color: white !important;
    border: none !important;
    border-radius: var(--radius-md) !important;
    padding: 10px 24px !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    text-transform: none !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all var(--transition-base) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary)) !important;
    box-shadow: var(--shadow-md) !important;
    transform: translateY(-1px) !important;
}

.btn-primary:active {
    transform: translateY(0) !important;
    box-shadow: var(--shadow-sm) !important;
}

/* Botão Secundário */
.btn-secondary {
    background: white !important;
    color: var(--primary) !important;
    border: 2px solid var(--primary) !important;
    border-radius: var(--radius-md) !important;
    padding: 9px 24px !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    text-transform: none !important;
    transition: all var(--transition-base) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.btn-secondary:hover {
    background: var(--primary) !important;
    color: white !important;
}

/* Botão de Sucesso */
.btn-success {
    background: linear-gradient(135deg, var(--success), #66bb6a) !important;
    color: white !important;
    border: none !important;
    border-radius: var(--radius-md) !important;
    padding: 10px 24px !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    text-transform: none !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all var(--transition-base) !important;
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-dark), var(--success)) !important;
    box-shadow: var(--shadow-md) !important;
    transform: translateY(-1px) !important;
}

/* Botão de Perigo */
.btn-danger {
    background: linear-gradient(135deg, var(--error), #e57373) !important;
    color: white !important;
    border: none !important;
    border-radius: var(--radius-md) !important;
    padding: 10px 24px !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    text-transform: none !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all var(--transition-base) !important;
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--error-dark), var(--error)) !important;
    box-shadow: var(--shadow-md) !important;
    transform: translateY(-1px) !important;
}

/* Botão Warning */
.btn-warning {
    background: linear-gradient(135deg, var(--warning), #ffb74d) !important;
    color: white !important;
    border: none !important;
    border-radius: var(--radius-md) !important;
    padding: 10px 24px !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    text-transform: none !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all var(--transition-base) !important;
}

.btn-warning:hover {
    background: linear-gradient(135deg, var(--warning-dark), var(--warning)) !important;
    box-shadow: var(--shadow-md) !important;
    transform: translateY(-1px) !important;
}

/* Botões Flutuantes (FAB) */
.btn-floating {
    width: 48px !important;
    height: 48px !important;
    border-radius: var(--radius-full) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: var(--shadow-md) !important;
    transition: all var(--transition-base) !important;
}

.btn-floating:hover {
    box-shadow: var(--shadow-lg) !important;
    transform: translateY(-2px) scale(1.05) !important;
}

.btn-floating.btn-small {
    width: 40px !important;
    height: 40px !important;
}

.btn-floating.btn-large {
    width: 56px !important;
    height: 56px !important;
}

/* ============================================
   CARDS PADRONIZADOS
   ============================================ */

.card-standard {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
    transition: all var(--transition-base);
    border: 1px solid var(--border-light);
}

.card-standard:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

body.dark-mode .card-standard {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--border-light);
}

body.dark-mode .card-header {
    border-bottom-color: var(--border-dark);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 12px;
}

body.dark-mode .card-title {
    color: var(--text-dark);
}

.card-title i {
    color: var(--primary);
}

/* ============================================
   BADGES DE STATUS
   ============================================ */

.status-badge {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.status-gerada {
    background: var(--success);
    color: white;
}

.status-paga {
    background: var(--info);
    color: white;
}

.status-cancelada {
    background: var(--error);
    color: white;
}

.status-enviada {
    background: var(--warning);
    color: white;
}

.status-falha {
    background: var(--error-dark);
    color: white;
}

.status-pendente {
    background: #fbbf24;
    color: white;
}

/* ============================================
   FORMULÁRIOS PADRONIZADOS
   ============================================ */

.input-field {
    margin-bottom: var(--space-lg);
}

.input-field label {
    color: var(--text-light) !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
}

body.dark-mode .input-field label {
    color: var(--text-dark) !important;
}

.input-field input[type="text"],
.input-field input[type="email"],
.input-field input[type="password"],
.input-field input[type="number"],
.input-field input[type="date"],
.input-field input[type="time"],
.input-field textarea,
.input-field select {
    border: 2px solid var(--border-light) !important;
    border-radius: var(--radius-md) !important;
    padding: 12px 16px !important;
    font-size: 0.95rem !important;
    transition: all var(--transition-base) !important;
    background: white !important;
    color: var(--text-light) !important;
    box-shadow: var(--shadow-sm) !important;
}

body.dark-mode .input-field input,
body.dark-mode .input-field textarea,
body.dark-mode .input-field select {
    background: var(--card-dark) !important;
    border-color: var(--border-dark) !important;
    color: var(--text-dark) !important;
}

.input-field input:focus,
.input-field textarea:focus,
.input-field select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1) !important;
}

/* Select2 Customizado */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border: 2px solid var(--border-light) !important;
    border-radius: var(--radius-md) !important;
    min-height: 48px !important;
    padding: 4px 8px !important;
}

.select2-container--default.select2-container--focus .select2-selection {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1) !important;
}

/* ============================================
   TABELAS PADRONIZADAS
   ============================================ */

.table-wrapper {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

body.dark-mode .table-wrapper {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.table-standard {
    width: 100%;
    border-collapse: collapse;
}

.table-standard thead {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.table-standard th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-standard td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-light);
    font-size: 0.95rem;
}

body.dark-mode .table-standard td {
    border-bottom-color: var(--border-dark);
    color: var(--text-dark);
}

.table-standard tbody tr {
    transition: background var(--transition-fast);
}

.table-standard tbody tr:hover {
    background: rgba(33, 150, 243, 0.05);
}

body.dark-mode .table-standard tbody tr:hover {
    background: rgba(33, 150, 243, 0.1);
}

/* ============================================
   FILTROS PADRONIZADOS
   ============================================ */

.filter-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

body.dark-mode .filter-section {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    cursor: pointer;
}

.filter-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

body.dark-mode .filter-title {
    color: var(--text-dark);
}

.filter-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.filter-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    flex-wrap: wrap;
}

/* ============================================
   MODAIS PADRONIZADOS
   ============================================ */

.modal {
    border-radius: var(--radius-lg) !important;
    max-height: 90vh !important;
}

.modal .modal-content {
    padding: var(--space-xl) !important;
}

.modal .modal-footer {
    padding: var(--space-lg) var(--space-xl) !important;
    background: var(--bg-light) !important;
}

body.dark-mode .modal {
    background: var(--card-dark) !important;
}

body.dark-mode .modal .modal-footer {
    background: var(--bg-dark) !important;
}

/* ============================================
   TOOLTIPS E POPOVERS
   ============================================ */

.tooltip-custom {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.tooltip-custom.show {
    opacity: 1;
}

/* ============================================
   NOTIFICAÇÕES/ALERTAS
   ============================================ */

.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success);
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--error);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info);
}

/* ============================================
   LOADING/SPINNER
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   UTILITÁRIOS
   ============================================ */

.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-error { color: var(--error) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }

.bg-primary { background: var(--primary) !important; }
.bg-success { background: var(--success) !important; }
.bg-error { background: var(--error) !important; }
.bg-warning { background: var(--warning) !important; }
.bg-info { background: var(--info) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }

.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (max-width: 768px) {
    .filter-content {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .filter-actions .btn {
        width: 100%;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
}

