:root {
    --bg-deep: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --accent: #6366f1;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: radial-gradient(circle at top left, #1e293b, var(--bg-deep));
    color: var(--text-main);
    min-height: 100vh;
    padding: 2rem;
    transition: background 0.3s ease, color 0.3s ease;
}

body.light-mode {
    --bg-deep: #f1f5f9;
    --bg-card: #ffffff;
    --accent: #4f46e5;
    --text-main: #0f172a;
    --text-muted: #475569;
    --glass-border: rgba(0, 0, 0, 0.1);
}

body.light-mode {
    background: radial-gradient(circle at top left, #f8fafc, #e2e8f0);
}

body.light-mode .kanban-column {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .column-header {
    color: var(--text-main);
}

body.light-mode .quick-search-input {
    background: #ffffff;
    color: var(--text-main);
    border-color: #cbd5e1;
}

body.light-mode .quick-search-input::placeholder {
    color: #94a3b8;
}

body.light-mode .badge {
    background: var(--accent);
    color: #ffffff;
}

body.light-mode input, body.light-mode select, body.light-mode textarea {
    background: #ffffff;
    color: var(--text-main);
    border-color: #cbd5e1;
}

body.light-mode .semaforo-ok { background: #dcfce7; border-color: #22c55e; color: #166534; }
body.light-mode .semaforo-hoy { background: #fef9c3; border-color: #eab308; color: #854d0e; }
body.light-mode .semaforo-alert { background: #fee2e2; border-color: #ef4444; color: #991b1b; }

.view-subtitle {
    margin: 2rem 0 1rem 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--accent);
    padding-left: 1rem;
}

.glass-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.light-mode .glass-card h3 {
    color: var(--text-main);
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    transition: color 0.3s;
}

.nav-links a.active {
    color: var(--accent);
}

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

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
}

.stat-card h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.view-container {
    animation: fadeIn 0.3s ease-in-out;
    margin-top: 1.5rem;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.table-container {
    padding: 0;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-main);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.btn-secondary {
    background: #475569;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #64748b;
}

body.light-mode .btn-secondary {
    background: #cbd5e1;
    color: #0f172a;
}

body.light-mode .btn-secondary:hover {
    background: #94a3b8;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #818cf8, #6366f1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;

}

.kanban-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.kanban-column {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 1rem;
    padding: 1rem;
    height: 80vh;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}

.kanban-column > div[id^="cards-"] {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 5px; /* Space for scrollbar */
}

/* Custom scrollbar for Kanban columns */
.kanban-column > div[id^="cards-"]::-webkit-scrollbar {
    width: 6px;
}
.kanban-column > div[id^="cards-"]::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.column-header {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.prospect-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
}

.prospect-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    border-color: var(--accent);
}

.prospect-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.prospect-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    background: #ffffff;
    color: var(--accent);
    border: 1px solid var(--accent);
    font-weight: 700;
}

body.light-mode .badge {
    background: #ffffff;
    color: var(--accent);
    border-color: var(--border-color);
}

.table-row-select {
    padding: 0.4rem;
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    width: 95%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 { margin-bottom: 1.5rem; }

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.prospect-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.full-width {
    grid-column: span 3;
}

.form-actions {
    margin-top: 1rem;
}

.input-with-button {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-icon {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: var(--accent);
    color: white;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-icon:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

input, select, textarea {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: white;
}

.timeline {
    margin: 1.5rem 0;
    max-height: 300px;
    overflow-y: auto;
}

.timeline-item {
    border-left: 2px solid var(--accent);
    padding-left: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
}

.timeline-date { font-size: 0.75rem; color: var(--text-muted); }

.prospect-origin-tag {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.2rem 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
}

.prospect-detail-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.prospect-detail-info div {
    font-size: 0.85rem;
}

.prospect-detail-info div span {
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Scrollable Table Improvements */
div.table-container.scrollable-table {
    max-height: 75vh;
    overflow-y: auto;
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.4);
    margin-top: 1rem;
}

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

#oferta-config-container {
    margin-bottom: 2rem;
    animation: slideDown 0.3s ease-out;
}

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

/* Appointment Styles */
.prospect-card-cita {
    display: grid;
    grid-template-columns: 1fr 100px;
    gap: 0.5rem;
    align-items: center;
}

.cita-info {
    border-left: 1px solid var(--glass-border);
    padding-left: 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    font-size: 0.65rem;
}

.semaforo-ok { background: rgba(34, 197, 94, 0.2); border: 1px solid #22c55e; color: #4ade80; }
.semaforo-hoy { background: rgba(234, 179, 8, 0.2); border: 1px solid #eab308; color: #fde047; }
.semaforo-alert { background: rgba(239, 68, 68, 0.2); border: 1px solid #ef4444; color: #fca5a5; }

.semaforo-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 4px;
}
.semaforo-dot.ok { background: #22c55e; }
.semaforo-dot.hoy { background: #eab308; }
.semaforo-dot.alert { background: #ef4444; }

.kanban-filter-container {
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.column-filter-panel {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border: 1px solid var(--glass-border);
}

.column-filter-panel select, .column-filter-panel input {
    width: 100%;
    padding: 0.3rem;
    font-size: 0.75rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    color: white;
    border-radius: 4px;
}

.quick-search-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.7rem;
    color: white;
    width: 60px;
    transition: width 0.3s ease;
}

.quick-search-input:focus {
    width: 120px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    border-color: var(--accent);
}

/* --- PRINT STYLES --- */
@media print {
    /* Hide navigation and elements not meant for printing */
    .navbar,
    .section-header button,
    .section-header .btn-primary,
    .section-header .btn-secondary,
    .section-header div[style*="display: flex; gap: 1rem"],
    #filtro-reportes-form,
    .kanban-filter-container,
    .column-filter-panel,
    .btn-icon {
        display: none !important;
    }

    /* Force white background and black text on body */
    body {
        background: white !important;
        color: black !important;
    }

    /* Reset view containers to flow naturally on page */
    .view-container {
        padding: 0 !important;
        margin: 0 !important;
        position: static !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    .main-content {
        height: auto !important;
        overflow: visible !important;
    }

    /* Remove glass effects, borders and shadows for print */
    .glass-card,
    .form-container,
    .table-container {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        box-shadow: none !important;
        color: black !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Style titles */
    h1, h2, h3.view-subtitle {
        color: black !important;
        margin-bottom: 10px !important;
    }

    /* Style the table for printing */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-top: 20px !important;
    }

    th, td {
        border: 1px solid #ccc !important;
        color: black !important;
        padding: 8px !important;
    }

    th {
        background-color: #f0f0f0 !important;
    }

    /* Strip background colors from pills */
    .view-pill {
        background: none !important;
        border: none !important;
        color: black !important;
        padding: 0 !important;
    }
}
/* --- TOAST NOTIFICATIONS --- */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 9999;
}

.toast {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid var(--accent);
}

.toast.success { border-left-color: #22c55e; }
.toast.error { border-left-color: #ef4444; }
.toast.info { border-left-color: #3b82f6; }

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

.toast.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

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