/* ==============================
   VARIABLES & RESET
   ============================== */
:root {
    --bg: #f0f2f5;
    --bg-card: #ffffff;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #334155;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #eff6ff;
    --success: #22c55e;
    --warning: #f97316;
    --danger: #ef4444;
    --purple: #a855f7;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --transition: all 0.2s ease;
    --sidebar-width: 260px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==============================
   SIDEBAR
   ============================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 28px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 300;
    letter-spacing: -0.5px;
}

.logo i {
    font-size: 28px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo strong {
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: white;
}

.nav-item.active {
    background: var(--sidebar-active);
    color: white;
}

.nav-item.active i {
    color: #3b82f6;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-role {
    font-size: 11px;
    color: #64748b;
}

/* ==============================
   MAIN CONTENT
   ============================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
}

.topbar-title {
    flex: 1;
}

.topbar-title h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.topbar-title p {
    font-size: 13px;
    color: var(--text-muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-box input {
    padding: 8px 16px 8px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    width: 240px;
    background: var(--bg);
    transition: var(--transition);
    font-family: inherit;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-icon {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg);
    color: var(--text-primary);
}

.btn-icon .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* ==============================
   CONTENT SECTIONS
   ============================== */
.content-section {
    display: none;
    padding: 32px;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

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

/* ==============================
   CARDS
   ============================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i {
    color: var(--primary);
}

/* ==============================
   STATS GRID
   ============================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
}

.stat-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stat-trend {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
}

.stat-trend.up {
    color: #16a34a;
    background: #f0fdf4;
}

.stat-trend.down {
    color: #dc2626;
    background: #fef2f2;
}

/* ==============================
   DASHBOARD GRID
   ============================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
}

.chart-card {
    min-height: 400px;
}

/* Category Bars */
.category-bars {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cat-label {
    width: 40px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.bar-track {
    flex: 1;
    height: 24px;
    background: var(--bg);
    border-radius: 12px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 1s ease;
}

.bar-value {
    width: 30px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Recent Leads */
.recent-leads {
    padding: 8px 0;
}

.lead-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

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

.lead-row:hover {
    background: var(--bg);
}

.lead-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.lead-info {
    flex: 1;
}

.lead-info strong {
    font-size: 14px;
    display: block;
}

.lead-info span {
    font-size: 12px;
    color: var(--text-muted);
}

.lead-time {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Funnel Summary */
.funnel-summary {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.funnel-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    min-width: 150px;
}

.funnel-bar strong {
    font-size: 20px;
}

/* ==============================
   SELECT SMALL
   ============================== */
.select-small {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-family: inherit;
    color: var(--text-secondary);
    background: white;
    cursor: pointer;
}

.link {
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.link:hover {
    text-decoration: underline;
}

/* ==============================
   FORM STYLES
   ============================== */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 32px;
    padding: 0 40px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    background: white;
    transition: var(--transition);
}

.progress-step.active .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.progress-step span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.progress-step.active span {
    color: var(--text-primary);
}

.progress-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 20px;
    max-width: 120px;
}

.form-page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-page.active {
    display: block;
}

.form-card {
    overflow: hidden;
}

.badge-required {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: #fef3c7;
    color: #92400e;
    font-weight: 500;
}

.form-body {
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.required {
    color: var(--danger);
}

.optional {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f0f9ff;
    color: #0369a1;
    font-weight: 500;
    margin-left: 8px;
}

.form-input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-help {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-help i {
    color: var(--primary);
}

.input-group {
    display: flex;
    gap: 0;
}

.prefix-select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg);
    color: var(--text-primary);
    width: 90px;
}

.input-group .form-input {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    flex: 1;
}

.input-with-prefix {
    display: flex;
    align-items: stretch;
}

.input-prefix {
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.with-prefix {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
    flex: 1;
}

.age-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
    border-radius: var(--radius-sm);
    border: 1px solid #bfdbfe;
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
}

.age-display i {
    font-size: 14px;
    opacity: 0.6;
}

/* Radio Cards (Budget) */
.budget-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.radio-card {
    cursor: pointer;
}

.radio-card input {
    display: none;
}

.radio-card-body {
    padding: 16px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.radio-card input:checked + .radio-card-body {
    border-color: var(--primary);
    background: var(--primary-light);
}

.radio-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.radio-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* Radio Pills (Level) */
.level-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.radio-pill {
    cursor: pointer;
}

.radio-pill input {
    display: none;
}

.radio-pill span {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 2px solid var(--border);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.radio-pill input:checked + span {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-area i {
    font-size: 32px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.upload-area p {
    font-size: 14px;
    color: var(--text-secondary);
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.form-help-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.form-help-link i {
    color: var(--primary);
    font-size: 12px;
}

.form-help-link a {
    color: var(--primary);
    text-decoration: none;
}

.form-help-link a:hover {
    text-decoration: underline;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #ff0000;
    font-size: 18px;
}

.with-icon {
    padding-left: 42px !important;
}

.form-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* Toggle Group */
.toggle-group {
    display: flex;
    gap: 12px;
}

.toggle-option input {
    display: none;
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.toggle-option input:checked + .toggle-btn {
    border-color: var(--success);
    background: #f0fdf4;
    color: #16a34a;
}

.toggle-option input:checked + .toggle-btn.active-no {
    border-color: var(--danger);
    background: #fef2f2;
    color: #dc2626;
}

.transfer-badge {
    padding: 12px 16px;
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--primary);
}

.transfer-badge i {
    margin-right: 6px;
}

.conditional-field {
    padding: 20px;
    background: #fafbfc;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}

.field-note {
    font-size: 12px;
    color: var(--warning);
    margin-bottom: 8px;
}

.field-note i {
    margin-right: 4px;
}

.form-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Buttons */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg);
}

/* ==============================
   CRM TABLE STYLES
   ============================== */
.crm-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--bg-card);
    padding: 6px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.crm-tab {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-secondary);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.crm-tab.active {
    background: var(--primary);
    color: white;
}

.crm-tab:hover:not(.active) {
    background: var(--bg);
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.chip:hover {
    border-color: var(--chip-color, var(--primary));
    color: var(--chip-color, var(--primary));
}

.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.filter-select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-family: inherit;
    background: white;
}

.crm-view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.crm-view.active {
    display: block;
}

.table-card {
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
}

.crm-table thead {
    background: var(--bg);
}

.crm-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

.crm-table td {
    padding: 14px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.crm-table tbody tr:hover {
    background: #fafbfc;
}

.crm-table.compact td {
    padding: 10px 16px;
}

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

/* Category Badges */
.category-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 700;
    color: white;
    min-width: 36px;
}

.cat-a-plus { background: #22c55e; }
.cat-a { background: #4ade80; }
.cat-a-minus { background: #86efac; color: #166534; }
.cat-b-plus { background: #f97316; }
.cat-b { background: #fb923c; }
.cat-b-minus { background: #fdba74; color: #9a3412; }
.cat-c-plus { background: #3b82f6; }
.cat-c { background: #60a5fa; }
.cat-c-minus { background: #93c5fd; color: #1e40af; }
.cat-d-plus { background: #a855f7; }
.cat-d { background: #c084fc; }
.cat-d-minus { background: #d8b4fe; color: #6b21a8; }
.cat-e-plus { background: #374151; }
.cat-e { background: #1f2937; }
.cat-transfer-plus { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.cat-transfer { background: linear-gradient(135deg, #0891b2, #2563eb); }

/* Level Tags */
.level-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.level-tag.professional { background: #fef3c7; color: #92400e; }
.level-tag.semipro { background: #dbeafe; color: #1e40af; }
.level-tag.competitive { background: #f0fdf4; color: #166534; }
.level-tag.amateur { background: #f5f3ff; color: #5b21b6; }

/* Status Icons */
.status-icon {
    font-size: 18px;
}

.status-icon.yes { color: var(--success); }
.status-icon.no { color: #d1d5db; }

.video-link {
    color: #ff0000;
    font-size: 18px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.video-link:hover {
    opacity: 0.8;
}

.video-link i {
    font-size: 18px;
}

/* Embudo Tags */
.embudo-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.embudo-tag.normal { background: #f0fdf4; color: #166534; }
.embudo-tag.transfer { background: #eff6ff; color: #1d4ed8; }

/* Estado Tags */
.estado-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.estado-tag.nuevo { background: #dbeafe; color: #1e40af; }
.estado-tag.contactado { background: #fef3c7; color: #92400e; }
.estado-tag.en-proceso { background: #f0fdf4; color: #166534; }

/* University Tag */
.uni-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 700;
    background: #1e293b;
    color: white;
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-action:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.table-footer {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
}

.pagination {
    display: flex;
    gap: 4px;
}

.page-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: white;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-btn:hover:not(.active):not(.disabled) {
    background: var(--bg);
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Category Groups (Vista 2) */
.category-groups {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.category-group {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.category-group-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
}

.category-group-header h4 {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-count {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Transfers Info Banner */
.transfers-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.transfers-info-banner > i {
    font-size: 24px;
    color: var(--primary);
    margin-top: 2px;
}

.transfers-info-banner strong {
    font-size: 15px;
    display: block;
    margin-bottom: 4px;
}

.transfers-info-banner p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.transfers-info-banner.large {
    padding: 32px;
    align-items: center;
}

.transfer-icon-big {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.transfer-icon-big i {
    font-size: 28px;
    color: white;
}

.transfers-info-banner.large h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

/* Filter Pills */
.filter-pills {
    display: flex;
    gap: 6px;
}

.pill {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pill:hover:not(.active) {
    background: var(--bg);
}

/* ==============================
   CLASSIFICATION STYLES
   ============================== */
.classification-header {
    margin-bottom: 32px;
}

.classification-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.classification-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.classification-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.class-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.class-group-title {
    font-size: 16px;
    font-weight: 700;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
}

.class-group-title.green { background: #f0fdf4; color: #166534; }
.class-group-title.orange { background: #fff7ed; color: #9a3412; }
.class-group-title.blue { background: #eff6ff; color: #1e40af; }
.class-group-title.purple { background: #faf5ff; color: #6b21a8; }
.class-group-title.dark { background: #f1f5f9; color: #1e293b; }
.class-group-title.transfer { background: linear-gradient(135deg, #ecfeff, #eff6ff); color: #0e7490; }

.class-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.class-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.class-badge {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 800;
    flex-shrink: 0;
}

.class-details h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
}

.class-criteria {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.class-criteria span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.class-criteria span.has {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.class-criteria span.missing {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.transfer-key-rule {
    padding: 16px 20px;
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 10px;
}

.transfer-key-rule i {
    font-size: 18px;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .budget-options {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .topbar {
        padding: 12px 16px;
    }
    
    .content-section {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .budget-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-box {
        display: none;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-chips {
        flex-wrap: wrap;
    }
    
    .crm-tabs {
        flex-wrap: wrap;
    }
}

/* ==============================
   SCROLLBAR
   ============================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Flag emoji */
.flag {
    font-size: 16px;
    margin-right: 4px;
}

/* ==============================
   SECURITY — Anti-copy protection
   ============================== */
@media print {
    body { display: none !important; }
    html::after {
        content: "Impresión no permitida — Documento protegido por Migue Studio";
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100vh;
        font-family: 'Inter', sans-serif;
        font-size: 18px;
        color: #999;
    }
}

img {
    pointer-events: none;
    -webkit-user-drag: none;
    user-drag: none;
}
