/* ==========================================================================
   DIGITAL CITY PROSPECTOR - ESTILOS UI/UX SAAS CRM (DARK NAVY / ELECTRIC BLUE)
   ========================================================================== */

:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #38bdf8;
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --accent: #3b82f6;

    --dark: #0f172a;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Layout Wrapper */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styling */
.app-sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 1040;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.sidebar-brand-text {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    color: #ffffff;
    line-height: 1.2;
}

.sidebar-brand-sub {
    font-size: 0.72rem;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-nav {
    padding: 1.25rem 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0.75rem 0.75rem 0.25rem 0.75rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.9rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    transition: var(--transition);
}

.sidebar-link:hover {
    background-color: var(--sidebar-hover);
    color: #ffffff;
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.25) 0%, rgba(56, 189, 248, 0.15) 100%);
    color: var(--sidebar-active);
    font-weight: 600;
    border-left: 3px solid var(--sidebar-active);
}

.sidebar-link.active i {
    color: var(--sidebar-active);
}

/* Main Content Area */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Navbar */
.app-navbar {
    height: 70px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    display: none;
}

.page-title-hdr {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.quick-search {
    position: relative;
    width: 280px;
}

.quick-search input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.4rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: #f1f5f9;
    font-size: 0.85rem;
    transition: var(--transition);
}

.quick-search input:focus {
    background-color: #fff;
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.quick-search i {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Content Container */
.content-body {
    padding: 1.75rem;
    flex: 1;
}

/* Stat Cards */
.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

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

.stat-title {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin: 0;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.primary { background: rgba(37, 99, 235, 0.1); color: var(--primary); }
.stat-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-icon.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.stat-icon.info { background: rgba(6, 182, 212, 0.1); color: var(--info); }

.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
    margin-bottom: 0.35rem;
}

.stat-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Custom Table Design */
.card-table {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header-flex {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-custom {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table-custom th {
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.table-custom td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
    color: var(--text-primary);
}

.table-custom tbody tr:last-child td {
    border-bottom: none;
}

.table-custom tbody tr {
    transition: var(--transition);
}

.table-custom tbody tr:hover {
    background-color: #f1f5f9;
}

/* Badges */
.badge-status {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-nuevo { background-color: #e0f2fe; color: #0369a1; }
.badge-contactado { background-color: #fef3c7; color: #b45309; }
.badge-interesado { background-color: #dcfce7; color: #15803d; }
.badge-seguimiento { background-color: #e0e7ff; color: #4338ca; }
.badge-cliente { background-color: #d1fae5; color: #047857; }
.badge-descartado { background-color: #f3f4f6; color: #4b5563; }

.badge-prioridad-alta { background-color: #fee2e2; color: #b91c1c; }
.badge-prioridad-media { background-color: #fef3c7; color: #b45309; }
.badge-prioridad-baja { background-color: #f3f4f6; color: #4b5563; }

/* Score Gauge / Indicator */
.score-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 800;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.score-high { background-color: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }
.score-medium { background-color: #fef3c7; color: #d97706; border: 1px solid #fcd34d; }
.score-low { background-color: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

/* Timeline for Seguimientos */
.timeline {
    position: relative;
    padding-left: 1.75rem;
    margin: 1rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-marker {
    position: absolute;
    left: -1.75rem;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-content {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

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

.timeline-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--dark);
    margin: 0;
}

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

/* Action Buttons */
.btn-action-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-whatsapp {
    background-color: #25d366 !important;
    color: #fff !important;
    border: none !important;
}

.btn-whatsapp:hover {
    background-color: #128c7e !important;
}

/* Footer */
.app-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-card);
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
    }
    
    .app-sidebar.show {
        left: 0;
    }
    
    .sidebar-toggle-btn {
        display: block;
    }
    
    .quick-search {
        width: 180px;
    }
}

@media (max-width: 575.98px) {
    .content-body {
        padding: 1rem;
    }
    
    .quick-search {
        display: none;
    }
}
