/* Sistema Chequinho - Design Moderno e Minimalista */

:root {
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
    --radius-lg: 1rem;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-50) 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Navbar Moderna */
.navbar {
    backdrop-filter: blur(12px);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    box-shadow: var(--shadow-lg);
    padding: 0.75rem 0;
    border: none;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i { font-size: 1.5rem; }

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.nav-link:hover { background: rgba(255,255,255,0.15); }

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background: var(--primary);
    color: white;
}

.dropdown-item i { margin-right: 0.5rem; opacity: 0.7; }

.container-fluid { flex: 1; max-width: 1400px; margin: 0 auto; padding: 1.5rem; }

/* Cards Modernos */
.card {
    background: white;
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 600;
    padding: 1rem 1.25rem;
    border: none;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.card-header.bg-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%) !important;
}

.card-header.bg-info {
    background: linear-gradient(135deg, var(--info) 0%, #0891b2 100%) !important;
    color: white;
}

.card-body { padding: 1.5rem; }

/* Tabelas Limpas */
.table {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    padding: 1rem;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-color: var(--gray-100);
}

.table-hover tbody tr {
    transition: background 0.15s ease;
}

.table-hover tbody tr:hover { background: var(--gray-50); }

/* Botões Modernos */
.btn {
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.2rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    color: white;
}

.btn-outline-secondary {
    border: 2px solid var(--gray-300);
    background: transparent;
    color: var(--gray-600);
}

.btn-outline-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-700);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-group-action .btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
}

/* Forms Elegantes */
.form-control, .form-select {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background: white;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

.form-control::placeholder { color: var(--gray-400); }

.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.required:after {
    content: " *";
    color: var(--danger);
}

/* Cards de Estatísticas */
.stat-card {
    text-align: center;
    padding: 2rem;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.stat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.stat-card .stat-number {
    font-size: 3rem;
    font-weight: 800;
    display: block;
    letter-spacing: -0.05em;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.9;
    font-weight: 600;
}

.stat-card.bg-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
    color: white;
}

.stat-card.bg-success {
    background: linear-gradient(135deg, #34d399 0%, #10b981 50%, #059669 100%);
    color: white;
}

.stat-card.bg-warning {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    color: white;
}

.stat-card.bg-info {
    background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 50%, #0891b2 100%);
    color: white;
}

/* Exames Selecionados */
.exames-selecionados {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 1.25rem;
    min-height: 120px;
    background: var(--gray-50);
    transition: all 0.2s ease;
}

.exames-selecionados:hover { border-color: var(--primary-light); }

.exames-selecionados .badge {
    font-size: 0.85rem;
    margin: 0.25rem;
    padding: 0.6rem 1rem;
    border-radius: 2rem;
    font-weight: 500;
}

/* Badges */
.badge-pacote {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
}

.badge-simples {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%) !important;
}

.bg-purple {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
}

/* Resultados de Busca */
.exame-resultado {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    transition: all 0.15s ease;
    cursor: pointer;
}

.exame-resultado:hover { background: var(--gray-50); }
.exame-resultado:last-child { border-bottom: none; }

.list-group-item {
    border: none;
    border-bottom: 1px solid var(--gray-100);
    padding: 0.9rem 1rem;
    transition: all 0.15s ease;
}

.list-group-item:hover { background: var(--gray-50); }
.list-group-item-action { cursor: pointer; }

/* Alertas */
.alert {
    border: none;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: #059669;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    color: #dc2626;
    border-left: 4px solid var(--danger);
}

/* Chequinho Print */
.chequinho-print {
    background: white;
    padding: 2.5rem;
    border: 2px solid var(--gray-800);
    max-width: 800px;
    margin: 0 auto;
    border-radius: var(--radius);
}

.chequinho-print .header {
    text-align: center;
    border-bottom: 2px solid var(--gray-800);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.chequinho-print .header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.chequinho-print .info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.chequinho-print .info-label { font-weight: 700; }

.chequinho-print .exames-list {
    border: 1px solid var(--gray-800);
    margin: 1.5rem 0;
}

.chequinho-print .exames-list th,
.chequinho-print .exames-list td {
    border: 1px solid var(--gray-800);
    padding: 0.75rem;
}

.chequinho-print .footer {
    margin-top: 2.5rem;
    display: flex;
    justify-content: space-between;
}

.chequinho-print .assinatura {
    border-top: 2px solid var(--gray-800);
    width: 220px;
    text-align: center;
    padding-top: 0.75rem;
    font-weight: 500;
}

/* Print */
@media print {
    body * { visibility: hidden; }
    .chequinho-print, .chequinho-print * { visibility: visible; }
    .chequinho-print {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: none;
    }
    .no-print { display: none !important; }
}

/* Responsive */
@media (max-width: 768px) {
    .stat-card .stat-number { font-size: 2rem; }
    .table-responsive { font-size: 0.85rem; }
    .container-fluid { padding: 1rem; }
    .card-body { padding: 1rem; }
}

/* Loading e Empty State */
.loading-spinner {
    display: none;
    text-align: center;
    padding: 2rem;
}

.loading-spinner.active { display: block; }

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-400);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

/* Animações Suaves */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .alert { animation: fadeIn 0.3s ease-out; }

/* Select2 Moderno */
.select2-container--bootstrap-5 .select2-selection {
    min-height: 44px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
}

.select2-container--bootstrap-5 .select2-selection--single:focus,
.select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Scrollbar Moderna */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* Títulos */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--gray-800);
}

h2 { font-size: 1.5rem; }
h2 i { margin-right: 0.5rem; opacity: 0.8; }
